magnitude is busted when both components are infinite.
authorTaylor R Campbell <campbell@mumble.net>
Tue, 20 Nov 2018 08:48:55 +0000 (08:48 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Tue, 20 Nov 2018 08:55:16 +0000 (08:55 +0000)
tests/runtime/test-arith.scm

index 24332b01c664c5aa92aa3b97575a26c8d5817ce2..4e0fa8b5ccd006e7aa3d078adbd0eb2cf7eaa645 100644 (file)
@@ -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