Welcome to Web-News
A Web-based News Reader
Subject Re: Errors in specification?
From Jarrett Billingsley <kb3ctd2@yahoo.com>
Date Thu, 12 Jun 2008 19:15:43 -0400
Newsgroups digitalmars.D.learn

"Simen Haugen" <simen.haugen@pandavre.com> wrote in message
news:g2s4uk$2nt7$1@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



Recent messages in this thread
 
-# Errors in specification? Simen Haugen 12-Jun-2008 05:37 pm
.-# Re: Errors in specification? (Current message) Jarrett Billingsley 12-Jun-2008 07:15 pm
.|-# Re: Errors in specification? Simen Haugen 13-Jun-2008 05:16 am
.|.\# Re: Errors in specification? Jarrett Billingsley 13-Jun-2008 08:55 am
.\# Re: Errors in specification? Gide Nwawudu 16-Jun-2008 06:15 am