From: Taylor R Campbell Date: Tue, 20 Nov 2018 09:15:53 +0000 (+0000) Subject: Test angles of partly infinite complex numbers. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~9 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c5a1a4a85aa2b8e70ceb83c55b84b1b6efff43a4;p=mit-scheme.git Test angles of partly infinite complex numbers. --- diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index 536160d0f..d18e254f0 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -769,4 +769,25 @@ USA. (infinite? (imag-part z)) 'xfail) (lambda () - (assert-inf+ (magnitude z)))))) \ No newline at end of file + (assert-inf+ (magnitude z)))))) + +(define-enumerated-test 'infinite-angle + (vector + (vector +inf.0 0.) ;XXX Why not exact, if imag-part is exact 0? + (vector -inf.0 pi) + (vector +inf.0+i 0.) + (vector +inf.0-i -0.) + (vector -inf.0-i (- pi)) + (vector -inf.0+i pi) + (vector 1+inf.0i (* pi 1/2)) + (vector 1-inf.0i (* pi -1/2)) + (vector -1-inf.0i (* pi -1/2)) + (vector -1+inf.0i (* pi 1/2)) + (vector +inf.0+inf.0i (* pi 1/4)) + (vector +inf.0-inf.0i (* pi -1/4)) + (vector -inf.0-inf.0i (* pi -3/4)) + (vector -inf.0+inf.0i (* pi 3/4))) + (lambda (v) + (let ((z (vector-ref v 0)) + (t (vector-ref v 1))) + (assert-<= (relerr t (angle z)) 1e-15)))) \ No newline at end of file