mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
force NaN not infinity on windows (consistent with std and other platforms)
This commit is contained in:
parent
232b1610de
commit
d02294a67f
@ -92,18 +92,21 @@ private:
|
||||
//
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(float value)
|
||||
{
|
||||
if (_isnan(value) != 0) return false;
|
||||
return _finite(value) == 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(double value)
|
||||
{
|
||||
if (_isnan(value) != 0) return false;
|
||||
return _finite(value) == 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(long double value)
|
||||
{
|
||||
if (_isnan(value) != 0) return false;
|
||||
return _finite(value) == 0;
|
||||
}
|
||||
|
||||
|
@ -605,6 +605,7 @@ void StringTest::testStringToFloat()
|
||||
assertTrue (FPEnvironment::isNaN(strToFloat("infinity")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToFloat("infinity", "infinity")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToFloat("-infinity", "infinity")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToFloat("1.23")));
|
||||
assertTrue (FPEnvironment::isNaN(strToFloat("Inf")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToFloat("Inf", "Inf")));
|
||||
|
||||
@ -612,6 +613,7 @@ void StringTest::testStringToFloat()
|
||||
assertTrue (FPEnvironment::isInfinite(strToFloat("-inf")));
|
||||
assertTrue (FPEnvironment::isInfinite(strToFloat("infinity", "infinity")));
|
||||
assertTrue (FPEnvironment::isInfinite(strToFloat("-infinity", "infinity")));
|
||||
assertTrue (!FPEnvironment::isInfinite(strToFloat("1.23")));
|
||||
assertTrue (!FPEnvironment::isInfinite(strToFloat("abc")));
|
||||
assertTrue (FPEnvironment::isInfinite(strToFloat("Inf", "Inf")));
|
||||
}
|
||||
@ -763,6 +765,7 @@ void StringTest::testStringToDouble()
|
||||
assertTrue (FPEnvironment::isNaN(strToDouble("infinity")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToDouble("infinity", "infinity")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToDouble("-infinity", "infinity")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToDouble("1.23")));
|
||||
assertTrue (FPEnvironment::isNaN(strToDouble("Inf")));
|
||||
assertTrue (!FPEnvironment::isNaN(strToDouble("Inf", "Inf")));
|
||||
|
||||
@ -770,6 +773,7 @@ void StringTest::testStringToDouble()
|
||||
assertTrue (FPEnvironment::isInfinite(strToDouble("-inf")));
|
||||
assertTrue (FPEnvironment::isInfinite(strToDouble("infinity", "infinity")));
|
||||
assertTrue (FPEnvironment::isInfinite(strToDouble("-infinity", "infinity")));
|
||||
assertTrue (!FPEnvironment::isInfinite(strToDouble("1.23")));
|
||||
assertTrue (!FPEnvironment::isInfinite(strToDouble("abc")));
|
||||
assertTrue (FPEnvironment::isInfinite(strToDouble("Inf", "Inf")));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user