Errors in specification?

BCS ao at pathlink.com
Fri Jun 13 10:45:55 PDT 2008


Reply to Jarrett,

> "Simen Haugen" <simen at norstat.no> wrote in message
> news:g2tdtv$e76$1 at digitalmars.com...
> 
>> "Jarrett Billingsley" wrote in message
>> 
>>> Either use std.math.isnan/tango.math.IEEE.isNaN, or a somewhat..
>>> funnier looking method:
>>> 
>>> float f2;
>>> f2 !<>= f2; // true
>> Thanks a lot
>> 
>> If I had checked the expression chapter I would have seen that. I
>> must say that at first I thought wtf! I had no idea what you were
>> doing there: "f2 not lt gt eq f2"?!? Sure is a long strange looking
>> operator.
>> 
> Heheh.  Well I don't think it actually mentions that that's a possible
> test for nan, but it just happens to work out because of the semantics
> of that operator.
> 

It's also the only thing it's useful for.

However I would like to see "f1 is f2" do an "incorrect" floating point comparison: 
(NaN is NaN) == true

I was planning on asking for it but Simen beat me to it.




More information about the Digitalmars-d-learn mailing list