Use std::isnan over self-inequality check

This commit is contained in:
Jeppe Tarp 2019-08-03 19:19:11 +02:00
parent 8739e21e6a
commit b15b56041d

View File

@ -161,7 +161,7 @@ inline Emitter& Emitter::WriteStreamable(T value) {
if (std::is_floating_point_v<T>) {
if ((std::numeric_limits<T>::has_quiet_NaN ||
std::numeric_limits<T>::has_signaling_NaN) &&
value != value) {
std::isnan(value)) {
special = true;
stream << ".nan";
} else if (std::numeric_limits<T>::has_infinity) {