[Development] Should QVariant be doing fuzzy comparisons on doubles?
Jędrzej Nowacki
jedrzej.nowacki at qt.io
Mon Sep 26 09:57:27 CEST 2016
On mandag 19. september 2016 09.20.48 CEST Thiago Macieira wrote:
> This code was there in Qt 5.0, so I kept it when I refactored the numeric
> comparisons. Now, dealing with QTBUG-56073, I'm wondering if it should be
> there in the first place.
>
> Should we do fuzzy comparisns in QVariant?
>
> Note that the fuzzy comparisons are always performed in qreal precision
> (whichever that may be), regardless of whether the original number is float,
> double or an integer.
No. I think we should avoid it, there are to many side effects of such
behavior change.
Cheers,
Jędrek
More information about the Development
mailing list