Is D floating point semantics too advanced?
Hans-Eric Grönlund
hasse42g at gmail.com
Fri Aug 24 11:11:17 PDT 2007
Finally a convincing reason for the behavior. I also realized, when reading up on the IEEE 754 specification, that NaN was not necessarily represented as one value, but could be a whole family of values. That complicates things further.
I hereby drop my case!
Thank you all for your comments!
Lars Noschinski Wrote:
> * Hans-Eric Grönlund <hasse42g at gmail.com> [07-08-23 16:45]:
> >Hello!
> >
> >I've written a post on my blog wondering if the floating point semantics is too advanced. The problem I have with it is that I can't write something like this:
> >
> >if (someValue == real.nan) {...}
>
> In this case it seems unintuitive because you use NaN explicitly on the
> right side. But you'd probably be surprised to see
>
> 0.0/0.0 == sqrt(-1.L)
>
> evaluating to true.
More information about the Digitalmars-d
mailing list