Use std::isnan over self-inequality check
This commit is contained in:
parent
8739e21e6a
commit
b15b56041d
@ -161,7 +161,7 @@ inline Emitter& Emitter::WriteStreamable(T value) {
|
|||||||
if (std::is_floating_point_v<T>) {
|
if (std::is_floating_point_v<T>) {
|
||||||
if ((std::numeric_limits<T>::has_quiet_NaN ||
|
if ((std::numeric_limits<T>::has_quiet_NaN ||
|
||||||
std::numeric_limits<T>::has_signaling_NaN) &&
|
std::numeric_limits<T>::has_signaling_NaN) &&
|
||||||
value != value) {
|
std::isnan(value)) {
|
||||||
special = true;
|
special = true;
|
||||||
stream << ".nan";
|
stream << ".nan";
|
||||||
} else if (std::numeric_limits<T>::has_infinity) {
|
} else if (std::numeric_limits<T>::has_infinity) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user