Fix etc__high_prec_dec__to_f64 shift amount

Shifting 0.299 left by 2 doesn't put us in [½ .. 1].
This commit is contained in:
Nigel Tao committed 2020-09-08 16:43:31 +10:00
1 parent 1210340e75
commit 57d47c633c
5 files changed
+37 -14

No files matched your search

@@ -1304,7 +1304,7 @@ wuffs_base__private_implementation__high_prec_dec__to_f64(
if (h->digits[0] >= 5) {
break;
}
shift = (h->digits[0] <= 2) ? 2 : 1;
shift = (h->digits[0] < 2) ? 2 : 1;
} else {
uint32_t n = (uint32_t)(-h->decimal_point);
shift = (n < num_powers)