Would I ever get an incorrect result if I promote 2 floats to double and do a 64bit comparison rather than a 32bit comparison?
Thanks.
Yes, if the difference between them is beyond the precision of the float type.For example, say you have the two double values:1.2342342341.234234230and that the precision of a float was only four decimal digits. That would mean that the two float values would be 1.234 and 1.234, hence equal.The double values are not equal however.However, if you're talking about floats being cast to doubles, then identical floats should give you identical doubles.
Yes, if the difference between them is beyond the precision of the float type.
ReplyDeleteFor example, say you have the two double values:
1.234234234
1.234234230
and that the precision of a float was only four decimal digits. That would mean that the two float values would be 1.234 and 1.234, hence equal.
The double values are not equal however.
However, if you're talking about floats being cast to doubles, then identical floats should give you identical doubles.