--- Comment #11 from yebblies <> 2011-06-27 20:40:16 PDT ---
(In reply to comment #10)
> I've been around numerics for 35 years now, and I've never seen a use for NaN
> payloads. I've never seen anyone even propose a use. Until then, I suspect
> supporting such would just cause problems.

This report has always been asking for a bitwise comparion, which is (as far as
I can tell) how every other type is treated by 'is'.

The use case I can remember being discussed is using 'v is float.init' to
determine if a floating point value is uninitialized or is a nan due to the
result of a calculation.

This seems to be the reason float.nan and float.init have different payloads in
the first place.

Currently this fails:

struct A { float f; }
A a;
A b;
b.f = float.nan;
assert((a is b) is (a.f is b.f));

Making 'is' for floating point types consistent with 'is' for other types seems
to me like a better move than introducing a new special case.

Maybe Steven or Don have an opinion on this feature they asked for?
'isIdentical' seems to do a straight bitwise comparison.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to