diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-01-05 05:29:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 14:29:21 +0100 |
commit | b2a53795dcfa96445e27eaea2147d2596a8e4994 (patch) | |
tree | 0865ec84d3e95a81b1de68a70e417acd22f86c5c | |
parent | d2f4f25b5660454c2483ab1249195b3a3d037588 (diff) | |
download | Nim-b2a53795dcfa96445e27eaea2147d2596a8e4994.tar.gz |
merge tmath_misc.nim into tmath.nim (#16591)
-rw-r--r-- | tests/stdlib/tmath.nim | 13 | ||||
-rw-r--r-- | tests/stdlib/tmath_misc.nim | 24 |
2 files changed, 13 insertions, 24 deletions
diff --git a/tests/stdlib/tmath.nim b/tests/stdlib/tmath.nim index 16c274032..a4b493b93 100644 --- a/tests/stdlib/tmath.nim +++ b/tests/stdlib/tmath.nim @@ -357,5 +357,18 @@ template main = doAssert copySign(10.0, -NaN) == 10.0 doAssert copySign(1.0, copySign(NaN, -1.0)) == -1.0 # fails in VM + block: + doAssert 1.0 / abs(-0.0) == Inf + doAssert 1.0 / abs(0.0) == Inf + doAssert -1.0 / abs(-0.0) == -Inf + doAssert -1.0 / abs(0.0) == -Inf + doAssert abs(0.0) == 0.0 + doAssert abs(0.0'f32) == 0.0'f32 + + doAssert abs(Inf) == Inf + doAssert abs(-Inf) == Inf + doAssert abs(NaN).isNaN + doAssert abs(-NaN).isNaN + static: main() main() diff --git a/tests/stdlib/tmath_misc.nim b/tests/stdlib/tmath_misc.nim deleted file mode 100644 index 978e3e94d..000000000 --- a/tests/stdlib/tmath_misc.nim +++ /dev/null @@ -1,24 +0,0 @@ -discard """ - targets: "c js" -""" - -# TODO merge this to tmath.nim once tmath.nim supports js target - -import math - -proc main() = - block: - doAssert 1.0 / abs(-0.0) == Inf - doAssert 1.0 / abs(0.0) == Inf - doAssert -1.0 / abs(-0.0) == -Inf - doAssert -1.0 / abs(0.0) == -Inf - doAssert abs(0.0) == 0.0 - doAssert abs(0.0'f32) == 0.0'f32 - - doAssert abs(Inf) == Inf - doAssert abs(-Inf) == Inf - doAssert abs(NaN).isNaN - doAssert abs(-NaN).isNaN - -static: main() -main() |