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

[MSVC] numeric_limits::quiet_NaN() and signaling_NaN() bits differ from native STL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.1.2, 4.1.3, 4.1.4, 4.2.0, 4.2.1
    • Fix Version/s: 4.2.2
    • Component/s: 18. Language Support
    • Labels:
      None
    • Environment:

      MSVC and ICC/Windows

    • Severity:
      Incorrect Behavior

      Description

      The binary representation of NAN's in stdcxx:

      #define _RWSTD_FLT_QNAN_BITS  { 0, 0, '\xc0', '\xff' }
      #define _RWSTD_FLT_SNAN_BITS  { '\x1', 0, '\x80', '\x7f' }
      #define _RWSTD_DBL_QNAN_BITS  { 0, 0, 0, 0, 0, 0, '\xf8', '\xff' }
      #define _RWSTD_DBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, '\xf0', '\x7f' }
      #define _RWSTD_LDBL_QNAN_BITS  { 0, 0, 0, 0, 0, 0, '\xf8', '\xff' }
      #define _RWSTD_LDBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, '\xf0', '\x7f' }
      

      The binary representation of the same things in MSVC STL:

      #define _RWSTD_FLT_QNAN_BITS  { 0, 0, '\xc0', '\x7f' }
      #define _RWSTD_FLT_SNAN_BITS  { '\x1', 0, '\xc0', '\x7f' }
      #define _RWSTD_DBL_QNAN_BITS  { 0, 0, 0, 0, 0, 0, '\xf8', '\x7f' }
      #define _RWSTD_DBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, '\xf8', '\x7f' }
      #define _RWSTD_LDBL_QNAN_BITS  { 0, 0, 0, 0, 0, 0, '\xf8', '\x7f' }
      #define _RWSTD_LDBL_SNAN_BITS  { '\x1', 0, 0, 0, 0, 0, '\xf8', '\x7f' }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sebor Martin Sebor
                Reporter:
                farid Farid Zaripov
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4h
                  4h
                  Remaining:
                  Remaining Estimate - 4h
                  4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified