summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2021-01-07 01:48:02 -0600
committerGitHub <noreply@github.com>2021-01-07 08:48:02 +0100
commitbab0aa6ecf8b91f9befaebefd0d4d5adeaac3ac3 (patch)
tree72d1c8afb81de6c1cf9f82de94fee343abbf7c60 /tests
parent4754806fb5d6afb034dc2d27959353ec579b08e4 (diff)
downloadNim-bab0aa6ecf8b91f9befaebefd0d4d5adeaac3ac3.tar.gz
add math.signbit (#16592)
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tmath.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/stdlib/tmath.nim b/tests/stdlib/tmath.nim
index e5cb58eba..62fdcd19f 100644
--- a/tests/stdlib/tmath.nim
+++ b/tests/stdlib/tmath.nim
@@ -304,6 +304,16 @@ block:
 
 template main =
   # xxx wrap all under `main` so it also gets tested in vm.
+  block: # signbit
+    doAssert not signbit(0.0)
+    doAssert signbit(-0.0)
+    doAssert signbit(-0.1)
+    doAssert not signbit(0.1)
+
+    doAssert not signbit(Inf)
+    doAssert signbit(-Inf)
+    doAssert not signbit(NaN)
+
   block: # isNaN
     doAssert NaN.isNaN
     doAssert not Inf.isNaN