Why do some T.init evaluate to true while others to false?

ArturG via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 26 08:42:05 PDT 2016


On Thursday, 26 May 2016 at 15:38:55 UTC, Basile B. wrote:

>
> because nan is not 0 and that the shortcut for float is
>
> if (fpValue) <=> if (fpValue != 0)
> if (!fpValue)<=> if (fpValue == 0)
>
> There's no relation between the initializer and the shortcut. 
> It's not because for some values the shortcut matches to the 
> initializer that it must always be the case...But I admit I 
> don't know the exact rationale.
>
> Does anyone know ?

Ok sorry for the noise and thanks anyway.


More information about the Digitalmars-d-learn mailing list