forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix nim-lang#16494 * fix * fix * fix * fix * fix * fix performance * add comments * improve performance * Update lib/system.nim Co-authored-by: Timothee Cour <[email protected]> * Update lib/system.nim Co-authored-by: Timothee Cour <[email protected]> * Update tests/stdlib/tmath_misc.nim Co-authored-by: Timothee Cour <[email protected]> * Update tests/stdlib/tmath_misc.nim Co-authored-by: Timothee Cour <[email protected]> Co-authored-by: Timothee Cour <[email protected]>
- Loading branch information
1 parent
5fb56a3
commit 9d4a1f9
Showing
2 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |