Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1978

NaN and Infinity differently JSON-encoded depending on platform

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.7.0
    • None
    • json, libbson
    • None

    Description

      In GCC and Clang, the double NAN (defined in math.h) is JSON-encoded like:

      {"value": nan}
      

      In Microsoft Visual Studio, it's:

      {"value": -nan(ind)}
      

      This is seems wrong and likely violates the Extended JSON Spec. Furthermore, Infinity is encoded as "inf" with GCC and Clang on Linux and Mac, but "Infinity" with GCC on Solaris.

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: