~ chicken-core (chicken-5) 640dce1e581ab43937c6dfc3cb86342327648c9b
commit 640dce1e581ab43937c6dfc3cb86342327648c9b Author: felix <felix@call-with-current-continuation.org> AuthorDate: Thu May 19 11:52:25 2022 +0200 Commit: Peter Bex <peter@more-magic.net> CommitDate: Fri May 20 11:19:42 2022 +0200 Added tests for "fp*+", contributed by Christian Himpe Signed-off-by: felix <felix@call-with-current-continuation.org> diff --git a/tests/library-tests.scm b/tests/library-tests.scm index 241203f4..bb7ae8a2 100644 --- a/tests/library-tests.scm +++ b/tests/library-tests.scm @@ -307,6 +307,35 @@ (assert (inexact= 7.0 (fp*+ 2.0 3.0 1.0))) (assert (inexact= 53.0 (fp*+ 10.0 5.0 3.0))) +;;; Tests contributed by Christian Himpe: + +;; original tests: +(assert (inexact= 7.0 (fp*+ 2.0 3.0 1.0))) +(assert (inexact= 53.0 (fp*+ 10.0 5.0 3.0))) + +;; my new tests: +(assert (inexact= 5.0 (fp*+ 1.0 2.0 3.0))) +(assert (inexact= 2.0 (fp*+ 1.0 2.0 0.0))) +(assert (inexact= 3.0 (fp*+ 1.0 0.0 3.0))) +(assert (inexact= 3.0 (fp*+ 0.0 2.0 3.0))) +(assert (inexact= 3.0 (fp*+ 0.0 0.0 3.0))) +(assert (inexact= -1.0 (fp*+ 2.0 0.5 -2.0))) +(assert (zero? (fp*+ 0.0 0.0 0.0))) +(assert (zero? (fp*+ -1.0 1.0 1.0))) +(assert (zero? (fp*+ 1.0 -1.0 1.0))) +(assert (zero? (fp*+ -1.0 -1.0 -1.0))) + +(assert (infinite? (fp*+ +inf.0 1.0 1.0))) +(assert (infinite? (fp*+ 1.0 +inf.0 1.0))) +(assert (infinite? (fp*+ 1.0 1.0 +inf.0))) +(assert (infinite? (fp*+ +inf.0 1.0 +inf.0))) +(assert (nan? (fp*+ -inf.0 1.0 +inf.0))) +(assert (nan? (fp*+ +nan.0 1.0 1.0))) +(assert (nan? (fp*+ 1.0 +nan.0 1.0))) +(assert (nan? (fp*+ 1.0 1.0 +nan.0))) +(assert (nan? (fp*+ 0.0 +inf.0 1.0))) +(assert (nan? (fp*+ -inf.0 0.0 1.0))) + ;; string->symbol ;; by Jim UrsettoTrap