it should still fix some issue IEEE-754 single-precision float has only 24 bits of mantissa, so obviously it can't represent exactly all integers in the 32-bit range For example if x = 16777216.0f, y = 1.0f then x + y is not equal to 16777217
will be helpful for those in need An IEEE754 64-bit double can represent any 32-bit integer, simply because it has 53-odd(a) bits available for precision and the 32-bit integer only needs, well, 32 :-) It would be plausible for a (non IEEE754 double precision) 64-bit floating point number to have less than 32 bits of precision. That would allow truly huge numbers (due to the exponent) but at the cost of precision.
Why does this precision fail example show up with doubles but not with floats?
this one helps. If std::numeric_limits::is_iec559 is true, then the guarantees of the IEEE 754 standard apply to floating point type F. Otherwise (and anyway), minimum permitted values of symbols such as DBL_DIG are specified by the C standard, which, undisputably for the library, “is incorporated into [the C++] International Standard by reference”, as quoted from C++11 §184.108.40.206/1.
How would you high precision compare floats & doubles sent into QML functions from Cpp side?