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

NaN and Infinity differently JSON-encoded depending on platform

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.7.0
    • Affects Version/s: None
    • Component/s: json, libbson
    • None

      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.

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

              Created:
              Updated:
              Resolved: