~ chicken-core (master) fd1788e3d80fd60ae3c3243ba59fead18021da04
commit fd1788e3d80fd60ae3c3243ba59fead18021da04
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Tue Jul 14 21:16:50 2026 +0200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Tue Jul 14 21:16:50 2026 +0200
number->string shows complex with negative zero as imaginary part correctly
diff --git a/library.scm b/library.scm
index 01e57d4d..5810b66d 100644
--- a/library.scm
+++ b/library.scm
@@ -2988,7 +2988,7 @@ EOF
(string-append
(number->string r base)
;; The infinities and NaN always print their sign
- (if (and (finite? i) (positive? i)) "+" "")
+ (if (and (finite? i) (>= i 0) (not (eqv? i -0.0))) "+" "")
(number->string i base) "i") ))
(else (##sys#error-bad-number n 'number->string))) ) ) )
Trap