aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.cpp
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 /src/tokenizer.cpp
parentaf509c68b01c8645e5efaeec7ea11e809f34ba7d (diff)
downloadzig-d04a1456df996aa51dd5eb5857528ed4a237ca13.tar.gz
zig-d04a1456df996aa51dd5eb5857528ed4a237ca13.zip
hex float parsing: solve another case
this works now: 0x1.edcb34a235253948765432134674fp-1
Diffstat (limited to 'src/tokenizer.cpp')
-rw-r--r--src/tokenizer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp
index 07ea4bf55a..a535d15680 100644
--- a/src/tokenizer.cpp
+++ b/src/tokenizer.cpp
@@ -365,6 +365,9 @@ static void end_float_token(Tokenize *t) {
bigint_init_unsigned(&shift_bigint, -shift);
BigInt shifted_significand;
bigint_shr(&shifted_significand, &t->significand, &shift_bigint);
+ if (t->exponent_in_bin_or_dec == -1) {
+ bigint_incr(&shifted_significand);
+ }
bigint_write_twos_complement(&shifted_significand, (uint8_t*) f_bits.repr, 128, false);
} else {
uint64_t sig_bits[2] = {0, 0};