From 7d8f70fb07a4636ad448511867b8174c48a34503 Mon Sep 17 00:00:00 2001 From: Yorick Hardy Date: Thu, 1 Feb 2024 22:23:16 +0200 Subject: [PATCH] add more tests for rounding r7rs requires (round x) to round to even when x is halfway between two integers, while C requires round(x) to round away from zero. --- tests/base.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/base.scm b/tests/base.scm index 3fea3896..fdd366fe 100644 --- a/tests/base.scm +++ b/tests/base.scm @@ -91,6 +91,9 @@ (test 4.0 (ceiling 3.5)) (test 3.0 (truncate 3.5)) (test 4.0 (round 3.5)) + (test 2.0 (round 2.5)) + (test -4.0 (round -3.5)) + (test -2.0 (round -2.5)) (test 4.0 (round 7/2)) ;; Rationals not supported, so result is inexact (test 7 (round 7))