hand sexc every digit of a test program's doubles

sextest prints the program it read back to sexc, and printed doubles
in CHICKEN's default 15 digits: 0.16666666666666666 arrived as
0.166666666666667, another number.
This commit is contained in:
2026-10-09 18:15:54 +03:00
parent e29c6ee5c9
commit 449a53abf9

View File

@@ -6,6 +6,7 @@
(chicken io)
(chicken pathname)
(chicken port)
(chicken flonum) ; flonum-print-precision
(chicken process)
(chicken process-context)
(chicken string) ; string-split
@@ -93,6 +94,9 @@
(let* ((proc (process compiler (append (list "-o" compiled-file) flags)))
(sexc-stdin (process-input-port proc)))
(symbol-escape #f)
;; ...nor any double in the 15 digits CHICKEN prints by default,
;; which make 0.16666666666666666 another number
(flonum-print-precision 17)
(with-output-to-port sexc-stdin
(fn (map (fn (fmt #t x)) src)))
(close-output-port sexc-stdin)