Skip to content

Commit a7675df

Browse files
committed
Make isnormal branchless
1 parent 2a17f6e commit a7675df

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

include/boost/decimal/decimal32_fast.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,7 @@ constexpr auto issignaling(decimal32_fast val) noexcept -> bool
464464

465465
constexpr auto isnormal(decimal32_fast val) noexcept -> bool
466466
{
467-
if (val.exponent_ <= static_cast<std::uint8_t>(detail::precision_v<decimal32> - 1))
468-
{
469-
return false;
470-
}
471-
472-
return (val.significand_ != 0) && isfinite(val);
467+
return (val.significand_ != 0) && isfinite(val) && (val.exponent_ > static_cast<std::uint8_t>(detail::precision_v<decimal32> - 1));
473468
}
474469

475470
constexpr auto isfinite(decimal32_fast val) noexcept -> bool

0 commit comments

Comments
 (0)