Skip to content

Commit 1d50f57

Browse files
committed
better wording.
1 parent 3a74bfb commit 1d50f57

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/fast_float/decimal_to_binary.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ compute_error(int64_t q, uint64_t w) noexcept {
9393
return compute_error_scaled<binary>(q, product.high, lz);
9494
}
9595

96-
// w * 10 ** q
97-
// The returned value should be a valid ieee64 number that simply need to be
96+
// Computers w * 10 ** q.
97+
// The returned value should be a valid number that simply needs to be
9898
// packed. However, in some very rare cases, the computation will fail. In such
9999
// cases, we return an adjusted_mantissa with a negative power of 2: the caller
100100
// should recompute in such cases.
@@ -158,7 +158,8 @@ compute_float(int64_t q, uint64_t w) noexcept {
158158
// next line is safe because -answer.power2 + 1 < 64
159159
answer.mantissa >>= -answer.power2 + 1;
160160
// Thankfully, we can't have both "round-to-even" and subnormals because
161-
// "round-to-even" only occurs for powers close to 0.
161+
// "round-to-even" only occurs for powers close to 0 in the 32-bit and
162+
// and 64-bit case (with no more than 19 digits).
162163
answer.mantissa += (answer.mantissa & 1); // round up
163164
answer.mantissa >>= 1;
164165
// There is a weird scenario where we don't have a subnormal but just.

0 commit comments

Comments
 (0)