Comparison issue

bearophile bearophileHUGS at lycos.com
Mon Mar 19 05:50:02 PDT 2012


James Miller:

>         writeln(v1 == 1); //false
>         writeln(v1 == 1.0); //false
>         writeln(v1 == 1.0f); //false
>         writeln(v1+1 == 2.0f); //true

Maybe I'd like to deprecate and then statically forbid the use of == among floating point values, and replace it with a library-defined function.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list