diff options
author | Andreas Rumpf <andreas@andreas-desktop> | 2009-12-14 01:38:05 +0100 |
---|---|---|
committer | Andreas Rumpf <andreas@andreas-desktop> | 2009-12-14 01:38:05 +0100 |
commit | 3b7ef2288f60bc5c355ad9aeaa127431ec3aee7b (patch) | |
tree | 5e028b11cf337290942b3cf6ecc599854de36747 /tests | |
parent | 911c1cb301a8483e463772b785b0aee79cf2a68c (diff) | |
download | Nim-3b7ef2288f60bc5c355ad9aeaa127431ec3aee7b.tar.gz |
floating point checks
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/99bottles.nim | 1 | ||||
-rwxr-xr-x | tests/tfloat1.nim | 8 | ||||
-rwxr-xr-x | tests/tfloat2.nim | 8 |
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/99bottles.nim b/tests/99bottles.nim new file mode 100755 index 000000000..14904ac0f --- /dev/null +++ b/tests/99bottles.nim @@ -0,0 +1 @@ +# Test if the compiler detects invalid module names diff --git a/tests/tfloat1.nim b/tests/tfloat1.nim new file mode 100755 index 000000000..89911dd61 --- /dev/null +++ b/tests/tfloat1.nim @@ -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] diff --git a/tests/tfloat2.nim b/tests/tfloat2.nim new file mode 100755 index 000000000..92421d446 --- /dev/null +++ b/tests/tfloat2.nim @@ -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] |