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

Qvariant comparison: -inf equals inf

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.9.0 Beta 2
    • 5.6.0
    • Core: Other
    • None
    • 14f09643441cc2938dc2791e790f6309ab12cb1d

          auto inf = std::numeric_limits<double>::infinity();
          auto neginf = -1 * inf;
          assert(inf != neginf);
      
          QVariant a(inf);
          QVariant b(neginf);
          assert(a != b);
      

      The second assertion fails, but IMHO it shouldn't. It all gets down to qFuzzyCompare(), which returns true for this case.

      There is a QTBUG-50036, that is somewhat similar and might have caused this issue.

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

            thiago Thiago Macieira
            danprinc danprinc
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes