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.

Reply via email to