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:
@@ -6,6 +6,7 @@
|
|||||||
(chicken io)
|
(chicken io)
|
||||||
(chicken pathname)
|
(chicken pathname)
|
||||||
(chicken port)
|
(chicken port)
|
||||||
|
(chicken flonum) ; flonum-print-precision
|
||||||
(chicken process)
|
(chicken process)
|
||||||
(chicken process-context)
|
(chicken process-context)
|
||||||
(chicken string) ; string-split
|
(chicken string) ; string-split
|
||||||
@@ -93,6 +94,9 @@
|
|||||||
(let* ((proc (process compiler (append (list "-o" compiled-file) flags)))
|
(let* ((proc (process compiler (append (list "-o" compiled-file) flags)))
|
||||||
(sexc-stdin (process-input-port proc)))
|
(sexc-stdin (process-input-port proc)))
|
||||||
(symbol-escape #f)
|
(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
|
(with-output-to-port sexc-stdin
|
||||||
(fn (map (fn (fmt #t x)) src)))
|
(fn (map (fn (fmt #t x)) src)))
|
||||||
(close-output-port sexc-stdin)
|
(close-output-port sexc-stdin)
|
||||||
|
|||||||
Reference in New Issue
Block a user