diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-04-27 12:43:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 12:43:38 +0200 |
commit | 8469c4b1be228f42c46f08852f028f7801b93cc9 (patch) | |
tree | f61121e8f89e39787a960e621fc8492e57fc4bc0 /tests/custom/00_syntax/10_numeric_literals | |
parent | f360350bd874aeec0806c8df02c7a20a54c44406 (diff) | |
parent | 64eec7f90e945696572ee076b75d1f35e8f2248a (diff) |
Merge pull request #5 from jow-/new-type-system
New type system
Diffstat (limited to 'tests/custom/00_syntax/10_numeric_literals')
-rw-r--r-- | tests/custom/00_syntax/10_numeric_literals | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/custom/00_syntax/10_numeric_literals b/tests/custom/00_syntax/10_numeric_literals new file mode 100644 index 0000000..3e367d0 --- /dev/null +++ b/tests/custom/00_syntax/10_numeric_literals @@ -0,0 +1,26 @@ +C-style numeric integer and float literals are understood, as well +as the special keywords "Infinity" and "NaN" to denote the IEEE 754 +floating point values. + +Numeric values are either stored as signed 64 bit integers or signed +doubles internally. + +-- Expect stdout -- +Integers literals: 123, 127, 2748, 57082 +Float literals: 10, 10.3, 1.23456e-65, 16.0625 +Special values: Infinity, Infinity, NaN, NaN +Minimum values: -9223372036854775808, -1.79769e+308 +Maximum values: 9223372036854775807, 1.79769e+308 +Minimum truncation: -9223372036854775808, -Infinity +Maximum truncation: 9223372036854775807, Infinity +-- End -- + +-- Testcase -- +Integers literals: {{ 123 }}, {{ 0177 }}, {{ 0xabc }}, {{ 0xDEFA }} +Float literals: {{ 10. }}, {{ 10.3 }}, {{ 123.456e-67 }}, {{ 0x10.1 }} +Special values: {{ Infinity }}, {{ 1 / 0 }}, {{ NaN }}, {{ "x" / 1 }} +Minimum values: {{ -9223372036854775808 }}, {{ -1.7976931348623158e+308 }} +Maximum values: {{ 9223372036854775807 }}, {{ 1.7976931348623158e+308 }} +Minimum truncation: {{ -10000000000000000000 }}, {{ -1.0e309 }} +Maximum truncation: {{ 10000000000000000000 }}, {{ 1.0e309 }} +-- End -- |