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

Impact of new C++20 math constants (<numbers>) on our code

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • Core: Other
    • None
    • C++20 <numbers> @ Qt

    Description

      C++20 added math constants to header <numbers> in the std::numbers namespace: http://eel.is/c++draft/numbers

      The feature-test macro is __cpp_lib_math_constants.

      There are the plain-named math constants (e, pi, sqrt2, etc), all of which are of type double, and there are the _v variable templates that hold template-argument-typed values of the corresponding constants.

      There are two aspects to this:

      1. we have our own FP type (qfloat16, and there's talk of a qfloat128)
        • we need to specialize the variable templates to work on qfloat16.
      2. we may want to backport std::numbers as q20::numbers to use around our code

      Attachments

        Issue Links

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

          Activity

            People

              cnn Qt Core & Network
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes