Comparison issue

James Miller james at aatch.net
Mon Mar 19 07:13:36 PDT 2012


On Mar 20, 2012 1:50 AM, "bearophile" <bearophileHUGS at lycos.com> wrote:
>
> 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

I wouldn't mind if it was just type weirdness, but its not. It appears that
1 does not equal 1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120320/a55a229d/attachment.html>


More information about the Digitalmars-d-learn mailing list