mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-01-01 03:12:18 +08:00
Minor optimization.
This commit is contained in:
parent
3d0e448940
commit
8b7a55a03c
@ -83,6 +83,7 @@ fastfloat_really_inline bool rounds_to_nearest() noexcept {
|
||||
// value so that 1 + x should round to 1 would do (after accounting for excess
|
||||
// precision, as in 387).
|
||||
static volatile float fmin = std::numeric_limits<float>::min();
|
||||
float fmini = fmin; // we copy it so that it gets loaded at most once.
|
||||
//
|
||||
// Explanation:
|
||||
// Only when fegetround() == FE_TONEAREST do we have that
|
||||
@ -105,7 +106,7 @@ fastfloat_really_inline bool rounds_to_nearest() noexcept {
|
||||
//
|
||||
// Note: This may fail to be accurate if fast-math has been
|
||||
// enabled, as rounding conventions may not apply.
|
||||
return (fmin + 1.0f == 1.0f - fmin);
|
||||
return (fmini + 1.0f == 1.0f - fmini);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user