aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-21 16:35:18 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-03-21 16:35:18 -0400
commitd04a1456df996aa51dd5eb5857528ed4a237ca13 (patch)
tree6f69a86696797ed91ef7ee95a1e63e5b68103074 /test
parentaf509c68b01c8645e5efaeec7ea11e809f34ba7d (diff)
downloadzig-d04a1456df996aa51dd5eb5857528ed4a237ca13.tar.gz
zig-d04a1456df996aa51dd5eb5857528ed4a237ca13.zip
hex float parsing: solve another case
this works now: 0x1.edcb34a235253948765432134674fp-1
Diffstat (limited to 'test')
-rw-r--r--test/stage1/behavior/math.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/stage1/behavior/math.zig b/test/stage1/behavior/math.zig
index 97ec8232d8..235ea1dbf6 100644
--- a/test/stage1/behavior/math.zig
+++ b/test/stage1/behavior/math.zig
@@ -310,8 +310,14 @@ test "quad hex float literal parsing accurate" {
const S = struct {
fn doTheTest() void {
- var f1: f128 = 0x1.2eab345678439abcdefea56782346p+5;
- expect(@bitCast(u128, f1) == 0x40042eab345678439abcdefea5678234);
+ {
+ var f1: f128 = 0x1.2eab345678439abcdefea56782346p+5;
+ expect(@bitCast(u128, f1) == 0x40042eab345678439abcdefea5678234);
+ }
+ {
+ var f: f128 = 0x1.edcb34a235253948765432134674fp-1;
+ expect(@bitCast(u128, f) == 0x3ffeedcb34a235253948765432134675);
+ }
const exp2ft = []f64{
0x1.6a09e667f3bcdp-1,
0x1.7a11473eb0187p-1,