On 2014-03-14 1:01 PM, Adam D. Ruppe wrote:
On Friday, 14 March 2014 at 16:50:11 UTC, bearophile wrote:
Keep in mind that there are many NaNs, and double.nan is not the same
as dounle init.
Oh yeah, I forgot about that! (double.init is a signaling nan while
double.nan is not. There's a whole bunch of other nans possible in
floating point too btw)
You're right. Looks like "is" always just compares the raw bits, which
is good stuff when comparing with init.
So this passes:
assert(test is double.init);
OK so I don't have to pack the structs to compare them! Thanks :)