Test sqrt along the negative real line with/without inexact imaginary part.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 30 Nov 2018 04:13:51 +0000 (04:13 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Fri, 30 Nov 2018 06:53:16 +0000 (06:53 +0000)
tests/runtime/test-arith.scm

index 7d8ae81d51f17c0afc989ffa9f8661df740e0405..ce4947c01d537256c2fb70f14656e263503643b6 100644 (file)
@@ -740,7 +740,15 @@ USA.
     (+inf.0+inf.0i +inf.0+inf.0i)
     (+inf.0-inf.0i +inf.0-inf.0i)
     (-inf.0+inf.0i +inf.0+inf.0i)
-    (-inf.0-inf.0i +inf.0-inf.0i))
+    (-inf.0-inf.0i +inf.0-inf.0i)
+    ;; Square root of negative real should be purely imaginary, whether
+    ;; exact or inexact.
+    (-4 +2i)
+    (-4. +2.i)
+    ;; Square root of negative real with inexact zero imaginary part
+    ;; should be imaginary with inexact zero real part.
+    (-4.+0.i 0.+2.i ,expect-failure)
+    (-4.-0.i 0.-2.i ,expect-failure))
   (lambda (z r #!optional xfail)
     (with-expected-failure xfail
       (lambda ()