From 449a53abf940bdaafe64afd32a7cec486a2dd9f0 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Fri, 9 Oct 2026 18:15:54 +0300 Subject: [PATCH] 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. --- tools/sextest/sextest.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/sextest/sextest.scm b/tools/sextest/sextest.scm index 43f3d5ff..459a8e51 100644 --- a/tools/sextest/sextest.scm +++ b/tools/sextest/sextest.scm @@ -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)