Skip to content

Commit d39b7ef

Browse files
matthew-reynoldseyalroz
authored andcommitted
Remove remaining double operations
1 parent c5aef36 commit d39b7ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/printf/printf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,8 @@ static floating_point_t pow10_of_int(int floored_exp10)
883883
}
884884
// Compute 10^(floored_exp10) but (try to) make sure that doesn't overflow
885885
floating_point_with_bit_access dwba;
886-
int exp2 = bastardized_floor((floating_point_t) (floored_exp10 * 3.321928094887362 + 0.5));
887-
const floating_point_t z = (floating_point_t) (floored_exp10 * 2.302585092994046 - exp2 * 0.6931471805599453);
886+
int exp2 = bastardized_floor(floored_exp10 * (floating_point_t) 3.321928094887362 + (floating_point_t) 0.5);
887+
const floating_point_t z = floored_exp10 * (floating_point_t) 2.302585092994046 - exp2 * (floating_point_t) 0.6931471805599453;
888888
const floating_point_t z2 = z * z;
889889
dwba.U = ((printf_fp_uint_t)(exp2) + FP_TYPE_BASE_EXPONENT) << FP_TYPE_STORED_MANTISSA_BITS;
890890
// compute exp(z) using continued fractions,

0 commit comments

Comments
 (0)