* 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>
This commit is contained in:
parent
5fb56a3b2c
commit
9d4a1f9554
2 changed files with 44 additions and 4 deletions
24
tests/stdlib/tmath_misc.nim
Normal file
24
tests/stdlib/tmath_misc.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue