Skip to content

Commit e302aa2

Browse files
committed
Align terminology
1 parent 4d52efc commit e302aa2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

zmij.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -606,16 +606,16 @@ ZMIJ_INLINE auto to_decimal(UInt bin_sig, int bin_exp, int dec_exp,
606606

607607
UInt scaled_sig = umul_upper_inexact_to_odd(pow10_hi, pow10_lo,
608608
bin_sig_shifted << exp_shift);
609-
UInt dec_sig_below = scaled_sig >> bound_shift;
610-
UInt dec_sig_above = dec_sig_below + 1;
609+
UInt longer_below = scaled_sig >> bound_shift;
610+
UInt longer_above = longer_below + 1;
611611

612612
// Pick the closest of dec_sig_below and dec_sig_above and check if it's in
613613
// the rounding interval.
614614
using sint = std::make_signed_t<UInt>;
615-
sint cmp = sint(scaled_sig - ((dec_sig_below + dec_sig_above) << 1));
616-
bool below_closer = cmp < 0 || (cmp == 0 && (dec_sig_below & 1) == 0);
617-
bool below_in = (dec_sig_below << bound_shift) >= lower;
618-
UInt dec_sig = (below_closer & below_in) ? dec_sig_below : dec_sig_above;
615+
sint cmp = sint(scaled_sig - ((longer_below + longer_above) << 1));
616+
bool below_closer = cmp < 0 || (cmp == 0 && (longer_below & 1) == 0);
617+
bool below_in = (longer_below << bound_shift) >= lower;
618+
UInt dec_sig = (below_closer & below_in) ? longer_below : longer_above;
619619
return normalize<num_bits>({int64_t(dec_sig), dec_exp}, subnormal);
620620
}
621621

0 commit comments

Comments
 (0)