Change float comparison operators to return false for NaN (bug 6107, r=ds).

--HG--
extra : rebase_source : a11c56fb23d6617545def3591ec6100dd143eb3e
This commit is contained in:
David Anderson
2014-04-22 19:40:45 -07:00
parent aa85a1866e
commit e69e9eddc7
10 changed files with 324 additions and 90 deletions
+5
View File
@@ -213,6 +213,11 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in
int significant_digits = 0; // number of significant digits written
const int MAX_SIGNIFICANT_DIGITS = 16;
if (isnan(fval)) {
AddString(buf_p, maxlen, "NaN", width, prec);
return;
}
// default precision
if (prec < 0)
{