Movement against float.init being nan

Walter Bright newshound2 at digitalmars.com
Tue Aug 30 15:55:27 UTC 2022


On 8/26/2022 9:22 AM, Steven Schveighoffer wrote:
> I'm not asking for this, I'm saying without having some sort of "fail upon use" 
> mechanism (be it a signal or an exception), it's just not effective at finding 
> initialization problems. What it has going for it over 0 is that it's 
> definitively a problem *if you happen to see it*. But you have to look for it, 
> and finding the source can be long gone by the time you see it.

If you don't look for errors in the output, you are even less likely to find it 
with 0 initialization.

I've also written here that there are legitimate uses of NaN where quitting upon 
use is undesirable.

It's analogous to the "Replacement Char" in Unicode. We have experience with 
throwing an exception on seeing an invalid code point. It's the wrong answer. 
It's so wrong it's one of the motivators for Phobos version 2.


More information about the Digitalmars-d mailing list