Skip to content

Commit

Permalink
Fix: isnan() shouldn't cause FP exceptions
Browse files Browse the repository at this point in the history
Fixes #3948.
  • Loading branch information
alexdewar authored and vitaut committed May 2, 2024
1 parent 17062a0 commit 8a8f482
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 8a8f482

Please sign in to comment.