Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.12.0
-
None
-
-
2ea3d2e924151843b8348871232eb88afb4cfe40 (qtbase/dev), a67e7e3bb (dev)
Description
All of these functions should return NaN, but QByteArray::toDouble() and qstrtod() returns 0.
double dbl1 = QString::fromLatin1("NaN").toDouble(&ok); // dbl1 = NaN, ok = true double dbl2 = QByteArray::fromRawData("NaN", 3).toDouble(&ok); // dbl2 = 0, ok = false double dbl3 = qstrtod("NaN", nullptr, &ok); // dbl3 = 0, ok = false double dbl4 = strtod("NaN", nullptr); // dbl4 = NaN
For lowercase "nan" all functions returns NaN, which is OK.
Attachments
Issue Links
- relates to
-
QTBUG-66466 QString::toDouble() doesn't parse -/+Infinity
- Closed