8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 04:03:03 +01:00

Another try to fix CORE-5570 - Negative infinity (double) shown incorrectly without sign in isql - without breaking MSVC build.

This commit is contained in:
Adriano dos Santos Fernandes 2017-07-24 11:33:47 +00:00
parent 6af61deaf9
commit 830372f0b9
2 changed files with 12 additions and 1 deletions

View File

@ -232,4 +232,15 @@ inline bool isinf(F x)
#endif // isinf
#endif // WIN_NT
namespace Firebird {
inline bool isNegativeInf(double x)
{
#ifdef WIN_NT
return _fpclass(x) == _FPCLASS_NINF;
#else
return x == -INFINITY;
#endif
}
}
#endif //CLASSES_FPE_CONTROL_H

View File

@ -6894,7 +6894,7 @@ static bool checkSpecial(TEXT* const p, const int length, const double value)
if (isnan(value))
t = "NaN";
else if (isinf(value))
t = "Infinity";
t = Firebird::isNegativeInf(value) ? "-Infinity" : "Infinity";
else
return false;