Always false float comparisons
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Mon May 9 05:30:13 PDT 2016
On 5/9/2016 5:21 AM, Ethan Watson wrote:
> I'd assume in the first case that the float is being promoted to double for the
> comparison. Is there already a warning for loss of precision?
Promoting to double does not lose precision.
> We treat warnings
> as errors in our C++ code, so C4244 triggers all the time in MSVC with integer
> operations. I just tested that float initialisation in MSVC, initialising a
> float with a double triggers C4305.
That's going quite a bit further.
More information about the Digitalmars-d
mailing list