From 342a5d6559fc56ef78a7484736297868ecbefcfd Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 18 Nov 2018 01:42:55 +0000 Subject: [PATCH] (make-polar mag 0) should always be mag even if infinite. --- tests/runtime/test-arith.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index 333383941..7c533512a 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -41,6 +41,9 @@ USA. (define assert-not-integer (predicate-assertion not-integer? "not integer")) +(define assert-real + (predicate-assertion real? "real number")) + (define (define-enumerated-test prefix elements procedure) (let ((n (vector-length elements))) (do ((i 0 (+ i 1))) ((>= i n)) @@ -134,6 +137,16 @@ USA. (lambda (l) (assert-nan (apply * l)))) +(define-enumerated-test 'polar0-real + (vector 0 0. -0. 1 1. -1.) + (lambda (magnitude) + (assert-real (make-polar magnitude 0)))) + +(define-enumerated-test 'polar0-real-xfail + (vector (flo:+inf.0) (flo:-inf.0)) + (lambda (magnitude) + (expect-failure (lambda () (assert-real (make-polar magnitude 0)))))) + (define-enumerated-test 'flo:ulp (vector (vector (flo:-inf.0) (flo:+inf.0)) -- 2.25.1