Raymond Toy pushed to branch issue-456-more-accurate-complex-div at cmucl / cmucl
Commits:
-
fd2e83a1
by Raymond Toy at 2025-12-12T15:38:35-08:00
-
b9494595
by Raymond Toy at 2025-12-12T15:54:05-08:00
-
e2b4641a
by Raymond Toy at 2025-12-13T14:24:22-08:00
-
16097f45
by Raymond Toy at 2025-12-13T14:24:22-08:00
-
f146f87f
by Raymond Toy at 2025-12-13T15:11:21-08:00
-
4a4c853d
by Raymond Toy at 2025-12-13T15:13:26-08:00
-
07341fe5
by Raymond Toy at 2025-12-13T15:15:36-08:00
-
1dfe13cb
by Raymond Toy at 2025-12-13T15:17:17-08:00
7 changed files:
- src/code/extensions.lisp
- src/code/unix.lisp
- src/compiler/float-tran-dd.lisp
- src/general-info/release-22a.md
- tests/float.lisp
- tests/pathname.lisp
- tests/unix.lisp
Changes:
| ... | ... | @@ -676,7 +676,7 @@ |
| 676 | 676 | subdirectories. Dirname must be a pathname to a directory. Any NAME
|
| 677 | 677 | or TYPE components in Dirname are ignored."
|
| 678 | 678 | (declare (type pathname dirname))
|
| 679 | - (when recusive
|
|
| 679 | + (when recursive
|
|
| 680 | 680 | ;; Find all the files or directories in DIRNAME.
|
| 681 | 681 | (dolist (path (directory (merge-pathnames "*.*" dirname)))
|
| 682 | 682 | ;; If the path is a directory, recursively delete the directory.
|
| ... | ... | @@ -2564,5 +2564,5 @@ |
| 2564 | 2564 | (cast result c-call:c-string)
|
| 2565 | 2565 | nil)
|
| 2566 | 2566 | status))
|
| 2567 | - (free-alien name)))))
|
|
| 2567 | + (free-alien result)))))
|
|
| 2568 | 2568 | |
| ... | ... | @@ -290,10 +290,10 @@ |
| 290 | 290 | (optimize (speed 3)))
|
| 291 | 291 | ;; If the numbers are too big, scale them done so SPLIT doesn't overflow.
|
| 292 | 292 | (multiple-value-bind (aa bb)
|
| 293 | - (values (if (> a +two970+)
|
|
| 293 | + (values (if (> (abs a) +two970+)
|
|
| 294 | 294 | (* a +two-53+)
|
| 295 | 295 | a)
|
| 296 | - (if (> b +two970+)
|
|
| 296 | + (if (> (abs b) +two970+)
|
|
| 297 | 297 | (* b +two-53+)
|
| 298 | 298 | b))
|
| 299 | 299 | (let ((p (* aa bb)))
|
| ... | ... | @@ -314,10 +314,10 @@ |
| 314 | 314 | (declare (optimize (inhibit-warnings 3)))
|
| 315 | 315 | ;; If the numbers was scaled down, we need to scale the
|
| 316 | 316 | ;; result back up.
|
| 317 | - (when (> a +two970+)
|
|
| 317 | + (when (> (abs a) +two970+)
|
|
| 318 | 318 | (setf p (* p +two53+)
|
| 319 | 319 | e (* e +two53+)))
|
| 320 | - (when (> b +two970+)
|
|
| 320 | + (when (> (abs b) +two970+)
|
|
| 321 | 321 | (setf p (* p +two53+)
|
| 322 | 322 | e (* e +two53+)))
|
| 323 | 323 | (values p e))))))))
|
| ... | ... | @@ -34,6 +34,8 @@ public domain. |
| 34 | 34 | * #446: Use C compiler to get errno values to update UNIX
|
| 35 | 35 | defpackage with errno symbols
|
| 36 | 36 | * #453: Use correct flags for analyzer and always save logs.
|
| 37 | + * #456: Improve accuracy for division of complex double-floats
|
|
| 38 | + * #458: Spurious overflow in double-double-float multiply
|
|
| 37 | 39 | * Other changes:
|
| 38 | 40 | * Improvements to the PCL implementation of CLOS:
|
| 39 | 41 | * Changes to building procedure:
|
| ... | ... | @@ -343,6 +343,16 @@ |
| 343 | 343 | (assert-true (typep new-mode 'x86::float-modes))
|
| 344 | 344 | (assert-equal new-mode (setf (x86::x87-floating-point-modes) new-mode))))
|
| 345 | 345 | |
| 346 | + |
|
| 347 | + |
|
| 348 | +;; Issue #458
|
|
| 349 | +(define-test dd-mult-overflow
|
|
| 350 | + (:tag :issues)
|
|
| 351 | + (assert-equal -2w300
|
|
| 352 | + (* -2w300 1w0)))
|
|
| 353 | + |
|
| 354 | + |
|
| 355 | + |
|
| 346 | 356 | ;; Rudimentary code to read C %a formatted numbers that look like
|
| 347 | 357 | ;; "-0x1.c4dba4ba1ee79p-620". We assume STRING is exactly in this
|
| 348 | 358 | ;; format. No error-checking is done.
|
| ... | ... | @@ -477,6 +487,7 @@ |
| 477 | 487 | (min (rerr (realpart computed) (realpart expected))
|
| 478 | 488 | (rerr (imagpart computed) (imagpart expected)))))
|
| 479 | 489 | |
| 490 | +;; Issue #456: improve accuracy of division of complex double-floats.
|
|
| 480 | 491 | (define-test complex-division.double
|
| 481 | 492 | (:tag :issues)
|
| 482 | 493 | (loop for k from 1
|
| ... | ... | @@ -142,3 +142,16 @@ |
| 142 | 142 | "/*.*")
|
| 143 | 143 | :truenamep nil :follow-links nil)))
|
| 144 | 144 | (assert-equal dir-tilde dir-home))))
|
| 145 | + |
|
| 146 | +(define-test delete-directory
|
|
| 147 | + (let ((dir (ensure-directories-exist "tmp/a/b/c/")))
|
|
| 148 | + ;; Verify that the directories were created.
|
|
| 149 | + (assert-equal "tmp/a/b/c/"
|
|
| 150 | + dir)
|
|
| 151 | + ;; Try to delete the directory. It should fail, which we verify
|
|
| 152 | + ;; by noting the directory listing is not empty.
|
|
| 153 | + (ext::delete-directory (pathname "tmp/"))
|
|
| 154 | + (assert-true (directory "tmp/"))
|
|
| 155 | + ;; Now recursively delete the directory.
|
|
| 156 | + (ext::delete-directory (pathname "tmp/") :recursive t)
|
|
| 157 | + (assert-false (directory "tmp/")))) |
| ... | ... | @@ -88,4 +88,7 @@ |
| 88 | 88 | (assert-false result)
|
| 89 | 89 | (assert-true (and (integerp errno) (plusp errno)))))
|
| 90 | 90 | |
| 91 | - |
|
| 91 | +(define-test unix-get-username
|
|
| 92 | + (let ((uid (unix:unix-getuid)))
|
|
| 93 | + (assert-true uid)
|
|
| 94 | + (assert-true (unix::unix-get-username uid)))) |