From c5a1a4a85aa2b8e70ceb83c55b84b1b6efff43a4 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Tue, 20 Nov 2018 09:15:53 +0000 Subject: [PATCH] Test angles of partly infinite complex numbers. --- tests/runtime/test-arith.scm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 -- 2.25.1