From: Taylor R Campbell Date: Sun, 18 Nov 2018 01:42:55 +0000 (+0000) Subject: (make-polar mag 0) should always be mag even if infinite. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~50 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=342a5d6559fc56ef78a7484736297868ecbefcfd;p=mit-scheme.git (make-polar mag 0) should always be mag even if infinite. --- 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))