floats default to NaN... why?
    Minas 
    minas_mina1990 at hotmail.co.uk
       
    Thu Jun  7 18:50:28 PDT 2012
    
    
  
I agree that the default value for floats/doubles should be zero. 
It feels much more natural.
I think the problem here is that people are thinking about some 
stuff too much. D is a rather new language that wants to be 
practical. Floats defaulting to NaN is NOT practical FOR MOST 
PEOPLE when at the same time I write:
int sum;
for(...)
   sum += blah blah blah
And it works.
Having floats deaulting to a value that's un-natural for most 
people is, in my opinion, craziness. Even if that's "more" 
correct in a mathematical sense.
Please excuse my English.
    
    
More information about the Digitalmars-d-learn
mailing list