File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ compute_error(int64_t q, uint64_t w) noexcept {
93
93
return compute_error_scaled<binary>(q, product.high , lz);
94
94
}
95
95
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
98
98
// packed. However, in some very rare cases, the computation will fail. In such
99
99
// cases, we return an adjusted_mantissa with a negative power of 2: the caller
100
100
// should recompute in such cases.
@@ -158,7 +158,8 @@ compute_float(int64_t q, uint64_t w) noexcept {
158
158
// next line is safe because -answer.power2 + 1 < 64
159
159
answer.mantissa >>= -answer.power2 + 1 ;
160
160
// 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).
162
163
answer.mantissa += (answer.mantissa & 1 ); // round up
163
164
answer.mantissa >>= 1 ;
164
165
// There is a weird scenario where we don't have a subnormal but just.
You can’t perform that action at this time.
0 commit comments