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

QString::setNum to convert a double into QString fails.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.8.0
    • None
    • Windows7(VS2010)

    Description

      When converting a double into QString using QString::setNum, the return value is wrong in release mode:

      Below is a code snippet to reproduce with. Notice that this certain incident is only reproducible in some machines.

      main() function
      int main(int argc, char *argv[])
      {
      QCoreApplication a(argc, argv);
      double _val = 375648293208.0;
      QString s;
      QString _amessage = s.setNum( _val, 'e', 15);
      printf(_amessage.toLatin1().constData());
      return 0;
      }
      

      in DEBUG _amessage contains : 3.756482932080000e+11 -> correct
      in RELEASE _amessage contains : 3.75648293207:000e+11 -> not correct

      If tested with 375648293209.0 or 375648293207.0 or 375648293208.1 it's correct in REALEASE and DEBUG.
      (Qt version used is installed from from "qt-win-commercial-4.8.0-vs2010.exe")

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            qtcomsupport Qt Support
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes