aboutsummaryrefslogtreecommitdiff
path: root/test/cases/math.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-28 08:48:19 -0400
committerGitHub <noreply@github.com>2017-09-28 08:48:19 -0400
commit0cfeefbf158e91922e367113c438c331d75ac1b4 (patch)
tree205d5ac64bf5f7a896fdd576a3e284b06b6cf714 /test/cases/math.zig
parentfd5a5db400995d80015448d19e92daaca71a7f72 (diff)
parent9dfe217be38289b0c9e662d1a0e7c0231bf42a7d (diff)
downloadzig-0cfeefbf158e91922e367113c438c331d75ac1b4.tar.gz
zig-0cfeefbf158e91922e367113c438c331d75ac1b4.zip
Merge pull request #502 from zig-lang/f128-literals
Allow 128-bit hex float literals
Diffstat (limited to 'test/cases/math.zig')
-rw-r--r--test/cases/math.zig15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/cases/math.zig b/test/cases/math.zig
index f950db1a14..1d29800aad 100644
--- a/test/cases/math.zig
+++ b/test/cases/math.zig
@@ -241,14 +241,21 @@ test "allow signed integer division/remainder when values are comptime known and
assert(-6 % 3 == 0);
}
-test "float literal parsing" {
+test "hex float literal parsing" {
comptime assert(0x1.0 == 1.0);
}
+test "quad hex float literal parsing in range" {
+ const a = 0x1.af23456789bbaaab347645365cdep+5;
+ const b = 0x1.dedafcff354b6ae9758763545432p-9;
+ const c = 0x1.2f34dd5f437e849b4baab754cdefp+4534;
+ const d = 0x1.edcbff8ad76ab5bf46463233214fp-435;
+}
+
test "hex float literal within range" {
- const a = 0x1.0p1023;
- const b = 0x0.1p1027;
- const c = 0x1.0p-1022;
+ const a = 0x1.0p16383;
+ const b = 0x0.1p16387;
+ const c = 0x1.0p-16382;
}
test "truncating shift left" {