Provide workaround for platforms where INFINITY is double

Fixes #1782
This commit is contained in:
Martin Hořeňovský 2019-10-21 18:31:05 +02:00
parent a2c8dce85c
commit 23c80bcc92
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -188,9 +188,10 @@ namespace Floating {
ret << ", "; ret << ", ";
write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps)); write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps));
} else { } else {
write(ret, step(static_cast<float>(m_target), -INFINITY, m_ulps)); // We have to cast INFINITY to float because of MinGW, see #1782
write(ret, step(static_cast<float>(m_target), static_cast<float>(-INFINITY), m_ulps));
ret << ", "; ret << ", ";
write(ret, step(static_cast<float>(m_target), INFINITY, m_ulps)); write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps));
} }
ret << "])"; ret << "])";