Files
Nim/tests/stdlib/tmath_misc.nim
flywind 9d4a1f9554 fix #16494 (#16513)
* fix #16494

* fix

* fix

* fix

* fix

* fix

* fix performance

* add comments

* improve performance

* Update lib/system.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Update lib/system.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Update tests/stdlib/tmath_misc.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Update tests/stdlib/tmath_misc.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-01 10:59:19 +01:00

25 lines
489 B
Nim

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()