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 Fix two important typos in unix-get-username and delete-directory In `unix-get-username`, we were freeing `name` instead of `result`. In `delete-directory`, we misspelled `recursive` as `recusive`. Fix these typos. - - - - - b9494595 by Raymond Toy at 2025-12-12T15:54:05-08:00 Add some tests for unix-get-username and delete-directory Add a simple test that unix-get-username returns something useful. Add a test for delete-directory that tests it deletes directories as specified, include recursively. - - - - - e2b4641a by Raymond Toy at 2025-12-13T14:24:22-08:00 Fix #458: Fix spurious overflow in double-double multiply - - - - - 16097f45 by Raymond Toy at 2025-12-13T14:24:22-08:00 Merge branch 'issue-458-double-double-mult-overflow' into 'master' Fix #458: Fix spurious overflow in double-double multiply Closes #458 See merge request cmucl/cmucl!337 - - - - - f146f87f by Raymond Toy at 2025-12-13T15:11:21-08:00 Add fixed issue #458 to release notes Forgot to do that. [skip-ci] - - - - - 4a4c853d by Raymond Toy at 2025-12-13T15:13:26-08:00 Merge branch 'master' into issue-456-more-accurate-complex-div - - - - - 07341fe5 by Raymond Toy at 2025-12-13T15:15:36-08:00 Add issue number for cdiv test [skip-ci] - - - - - 1dfe13cb by Raymond Toy at 2025-12-13T15:17:17-08:00 Add #456 to release notes - - - - - 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: ===================================== src/code/extensions.lisp ===================================== @@ -676,7 +676,7 @@ subdirectories. Dirname must be a pathname to a directory. Any NAME or TYPE components in Dirname are ignored." (declare (type pathname dirname)) - (when recusive + (when recursive ;; Find all the files or directories in DIRNAME. (dolist (path (directory (merge-pathnames "*.*" dirname))) ;; If the path is a directory, recursively delete the directory. ===================================== src/code/unix.lisp ===================================== @@ -2564,5 +2564,5 @@ (cast result c-call:c-string) nil) status)) - (free-alien name))))) + (free-alien result))))) ===================================== src/compiler/float-tran-dd.lisp ===================================== @@ -290,10 +290,10 @@ (optimize (speed 3))) ;; If the numbers are too big, scale them done so SPLIT doesn't overflow. (multiple-value-bind (aa bb) - (values (if (> a +two970+) + (values (if (> (abs a) +two970+) (* a +two-53+) a) - (if (> b +two970+) + (if (> (abs b) +two970+) (* b +two-53+) b)) (let ((p (* aa bb))) @@ -314,10 +314,10 @@ (declare (optimize (inhibit-warnings 3))) ;; If the numbers was scaled down, we need to scale the ;; result back up. - (when (> a +two970+) + (when (> (abs a) +two970+) (setf p (* p +two53+) e (* e +two53+))) - (when (> b +two970+) + (when (> (abs b) +two970+) (setf p (* p +two53+) e (* e +two53+))) (values p e)))))))) ===================================== src/general-info/release-22a.md ===================================== @@ -34,6 +34,8 @@ public domain. * #446: Use C compiler to get errno values to update UNIX defpackage with errno symbols * #453: Use correct flags for analyzer and always save logs. + * #456: Improve accuracy for division of complex double-floats + * #458: Spurious overflow in double-double-float multiply * Other changes: * Improvements to the PCL implementation of CLOS: * Changes to building procedure: ===================================== tests/float.lisp ===================================== @@ -343,6 +343,16 @@ (assert-true (typep new-mode 'x86::float-modes)) (assert-equal new-mode (setf (x86::x87-floating-point-modes) new-mode)))) + + +;; Issue #458 +(define-test dd-mult-overflow + (:tag :issues) + (assert-equal -2w300 + (* -2w300 1w0))) + + + ;; Rudimentary code to read C %a formatted numbers that look like ;; "-0x1.c4dba4ba1ee79p-620". We assume STRING is exactly in this ;; format. No error-checking is done. @@ -477,6 +487,7 @@ (min (rerr (realpart computed) (realpart expected)) (rerr (imagpart computed) (imagpart expected))))) +;; Issue #456: improve accuracy of division of complex double-floats. (define-test complex-division.double (:tag :issues) (loop for k from 1 ===================================== tests/pathname.lisp ===================================== @@ -142,3 +142,16 @@ "/*.*") :truenamep nil :follow-links nil))) (assert-equal dir-tilde dir-home)))) + +(define-test delete-directory + (let ((dir (ensure-directories-exist "tmp/a/b/c/"))) + ;; Verify that the directories were created. + (assert-equal "tmp/a/b/c/" + dir) + ;; Try to delete the directory. It should fail, which we verify + ;; by noting the directory listing is not empty. + (ext::delete-directory (pathname "tmp/")) + (assert-true (directory "tmp/")) + ;; Now recursively delete the directory. + (ext::delete-directory (pathname "tmp/") :recursive t) + (assert-false (directory "tmp/")))) ===================================== tests/unix.lisp ===================================== @@ -88,4 +88,7 @@ (assert-false result) (assert-true (and (integerp errno) (plusp errno))))) - +(define-test unix-get-username + (let ((uid (unix:unix-getuid))) + (assert-true uid) + (assert-true (unix::unix-get-username uid)))) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/6f6a87580e30627db108944... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/6f6a87580e30627db108944... You're receiving this email because of your account on gitlab.common-lisp.net.