From: Taylor R Campbell Date: Tue, 20 Nov 2018 08:48:55 +0000 (+0000) Subject: magnitude is busted when both components are infinite. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~11 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c3e19280e15b90de9e31a17049a27c57c73d357b;p=mit-scheme.git magnitude is busted when both components are infinite. --- diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index 24332b01c..4e0fa8b5c 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -739,4 +739,28 @@ USA. (exp (flo:nextafter flo:greatest-normal-exponent-base-e (flo:+inf.0)))) (assert-inf+ (expt 10. - (flo:nextafter flo:greatest-normal-exponent-base-2 (flo:+inf.0)))))) \ No newline at end of file + (flo:nextafter flo:greatest-normal-exponent-base-2 (flo:+inf.0)))))) + +(define-enumerated-test 'infinite-magnitude + (vector + +inf.0 + -inf.0 + +inf.0+i + +inf.0-i + -inf.0-i + -inf.0+i + 1+inf.0i + 1-inf.0i + -1-inf.0i + -1+inf.0i + +inf.0+inf.0i + +inf.0-inf.0i + -inf.0-inf.0i + -inf.0+inf.0i) + (lambda (z) + (with-expected-failure + (and (infinite? (real-part z)) + (infinite? (imag-part z)) + 'xfail) + (lambda () + (assert-inf+ (magnitude z)))))) \ No newline at end of file