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

QJsonValue toDouble() conversion causes loss of data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.1.0
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None
    • Environment:
      windows-7

      Description

      QJsonObject obj;
      obj.insert("dbl",double(73183493944884961));

      double d = obj.value("dbl").toDouble();
      qulonglong ul = d;
      qulonglong ul2 = 73183493944884961;

      qDebug () << ul << ul2;
      //output : 73183493944884960 73183493944884961

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              thiago Thiago Macieira
              Reporter:
              ashish.soni ashish soni
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes