float init 0 request
Alexandru Ermicioi
alexandru.ermicioi at gmail.com
Fri Aug 14 07:05:06 UTC 2026
On Friday, 14 August 2026 at 06:38:02 UTC, Walter Bright wrote:
> Floats are default initialized to NaN so people will be coerced
> to explicitly code what they want the initialized value to be.
>
> I've seen enough code where the programmer forgot to initialize
> a float, it was defaulted to 0, and the wrong result was not
Why not make it an error, a float that is not explicitly
initialized? Would be way better than implicit nan
initialization, right?
More information about the Digitalmars-d
mailing list