Errors in specification?

Jarrett Billingsley kb3ctd2 at yahoo.com
Thu Jun 12 16:15:43 PDT 2008


"Simen Haugen" <simen.haugen at pandavre.com> wrote in message 
news:g2s4uk$2nt7$1 at digitalmars.com...
> This is the property example from 
> http://digitalmars.com/d/1.0/property.html
>
> ...
>
> Ditto for other types.

The behavior of .init was changed in 1.017.  Per-variable .inits now just 
get the .init of the type.  I don't know why the spec hasn't been updated to 
match.

>
> And is it possible to check if a float is nan?
> float f2;
> f2 is float.nan; // false
> f2.init is float.init; // false
> float.nan is float.nan; // false...

Either use std.math.isnan/tango.math.IEEE.isNaN, or a somewhat.. funnier 
looking method:

float f2;
f2 !<>= f2; // true 




More information about the Digitalmars-d-learn mailing list