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

Support C99/C++14 hex floats

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • Core: Locales (i18n)
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes