floating point checks
This commit is contained in:
parent
911c1cb301
commit
3b7ef2288f
30 changed files with 611 additions and 631 deletions
1
tests/99bottles.nim
Executable file
1
tests/99bottles.nim
Executable file
|
|
@ -0,0 +1 @@
|
|||
# Test if the compiler detects invalid module names
|
||||
8
tests/tfloat1.nim
Executable file
8
tests/tfloat1.nim
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
# Test new floating point exceptions
|
||||
|
||||
{.floatChecks: on.}
|
||||
|
||||
var x = 0.8
|
||||
var y = 0.0
|
||||
|
||||
echo x / y #OUT Error: unhandled exception: FPU operation caused an overflow [EFloatOverflow]
|
||||
8
tests/tfloat2.nim
Executable file
8
tests/tfloat2.nim
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
# Test new floating point exceptions
|
||||
|
||||
{.floatChecks: on.}
|
||||
|
||||
var x = 0.0
|
||||
var y = 0.0
|
||||
|
||||
echo x / y #OUT Error: unhandled exception: FPU operation caused a NaN result [EFloatInvalidOp]
|
||||
Loading…
Add table
Add a link
Reference in a new issue