Fix: isnan() shouldn't cause FP exceptions

Fixes #3948.
This commit is contained in:
Alex Dewar 2024-05-02 14:46:57 +01:00 committed by Victor Zverovich
parent 17062a0c9b
commit 8a8f4825a3

View File

@ -2695,7 +2695,7 @@ FMT_CONSTEXPR20 auto write_float(OutputIt out, const DecimalFP& f,
}
template <typename T> constexpr auto isnan(T value) -> bool {
return !(value >= value); // std::isnan doesn't support __float128.
return value != value; // std::isnan doesn't support __float128.
}
template <typename T, typename Enable = void>