Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
-
hex-floats
Description
C99 and C++14 added hexadecimal floating point literals and corresponding I/O functions. Qt never implemented it.
The main advantage of hex floats is that, unlike decimal notation, they are always exactly representable in the binary form.
This epic exists to collect the places where we need to implement support.
To wit:
- QString::asprintf() ignores the a specifier and outputs decimal instead
- QString::fromNumber()/QString::toFloat/Double don't have API to request hex floats
- Qt::hex doesn't have an effect on QTextStream FP streaming
- Decimal literals in Qt tests or implementation that are not exactly representable should be rewritten as hex
- QTest::toString() could output floating point numbers (also) in hex, preserving the exact value of the binary value in the log
Attachments
Issue Links
- relates to
-
QTBUG-95458 Add support for hexadecimal floating-point format in QLocale, QString and QByteArray
- Reported
-
QTBUG-85779 Support a "hexfloat" format for doubles, similar to std::ios
- Open