mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 20:18:49 +00:00
Move zero-check to an earlier branch (#1906)
This commit is contained in:
parent
90ef46df0b
commit
6f3536f974
@ -2258,6 +2258,9 @@ FMT_SAFEBUFFERS decimal_fp<T> to_decimal(T x) FMT_NOEXCEPT {
|
||||
(static_cast<carrier_uint>(1) << float_info<T>::significand_bits);
|
||||
} else {
|
||||
// Subnormal case; the interval is always regular.
|
||||
if (significand == 0) {
|
||||
return decimal_fp<T>{0, 0};
|
||||
}
|
||||
exponent = float_info<T>::min_exponent - float_info<T>::significand_bits;
|
||||
}
|
||||
|
||||
@ -2307,10 +2310,6 @@ FMT_SAFEBUFFERS decimal_fp<T> to_decimal(T x) FMT_NOEXCEPT {
|
||||
goto small_divisor_case_label;
|
||||
}
|
||||
}
|
||||
if (ret_value.significand == 0) {
|
||||
ret_value.exponent = 0;
|
||||
return ret_value;
|
||||
}
|
||||
ret_value.exponent = minus_k + float_info<T>::kappa + 1;
|
||||
|
||||
// We may need to remove trailing zeros
|
||||
|
Loading…
Reference in New Issue
Block a user