Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-897

[MSVC] 18.numeric.special.float test fails

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.2.1
    • 4.2.2
    • Tests
    • None
    • MSVC

    • Patch Available
    • Incorrect Behavior

    Description

      The 18.numeric.special.float test fails with the following assertions:

      # ASSERTION (S7) (4 lines):
      # TEXT: _fpclass(numeric_limits<float>::signaling_NaN()) == 1 (_FPCLASS_SNAN), got 2 (_FPCLASS_QNAN)
      # CLAUSE: numeric.special
      # LINE: 318
      
      # ASSERTION (S7) (4 lines):
      # TEXT: numeric_limits<float>::has_denorm == -1, got 1
      # CLAUSE: numeric.special
      # LINE: 1360
      
      # ASSERTION (S7) (4 lines):
      # TEXT: numeric_limits<double>::has_denorm == -1, got 1
      # CLAUSE: numeric.special
      # LINE: 1360
      
      # ASSERTION (S7) (4 lines):
      # TEXT: numeric_limits<long double>::has_denorm == -1, got 1
      # CLAUSE: numeric.special
      # LINE: 1360
      

      The first assertions is caused due to MSVC provides _fpclass() function for double type only and X87 and SSE floating point commands are incorrect converting float signaling NaN value to double type. So for example the float signaling NaN value with bitmask 0x7F800001, calculated in INFINITY config test, is converted to double value with bitmask 0x7ff8000020000000, which is a quiet NaN value.

      The rest of the assertions are caused due to test expects, that numeric_limits<>::has_denorm == 1 on the AIX, __hpux and __osf_ platforms only.

      Attachments

        Activity

          People

            farid Farid Zaripov
            farid Farid Zaripov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h

                Slack

                  Issue deployment