Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127280

Support C99/C++14 hex floats

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • Core: Locales (i18n)
    • None
    • hex-floats
    • 395d23fbb (dev)

      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

        For Gerrit Dashboard: QTBUG-127280
        # Subject Branch Project Status CR V

            Eddy Edward Welbourne
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes