floats default to NaN... why?

Minas minas_mina1990 at hotmail.co.uk
Fri Jun 8 16:52:19 PDT 2012


> The idea isn't being "practical" exactly.  The idea was to use 
> invalid
> values as defaults. Unfortunately things like ints don't have 
> invalid
> values, so they chose zero.  The idea is to make people 
> initialize their
> variables.

I understand the logic, but I still disagree. No offense :)
I don't like inconsistency though (that ints are 
zero-initialized).



More information about the Digitalmars-d-learn mailing list