floats default to NaN... why?

F i L witte2008 at gmail.com
Sun Apr 15 20:04:10 PDT 2012


Actually, all of this discussion has made me think that having a 
compiler flag to change FP values to zero as default would be a 
good idea.

Basically my opinion is largely influenced by a couple things. 
That is:

- I believe a lot of good programmers are used to using zero for 
default. Winning them over is a good thing for everyone here. I'm 
not trying to blow this issue out of proportion, I understand 
this isn't all that big a deal, but papercuts do count.

- My major project in D is a game engine. I want D to not only be 
used for the engine, but also to serve as the "scripting" 
language as well. Thus, I want D knowledge prerequisite to be as 
low as possible. I still think that 0 should be used as default 
in D, however, I'd be more than happy to have a compiler flag for 
this as well.



I've been wanting to try and contribute to D for awhile now. I've 
looked through the source; haven't coded in C++ in a long time, 
and never professionally, but I should be able to tackle 
something like adding a compiler flag to default FP variables to 
zero. If I write the code, would anyone object to having a flag 
for this?


More information about the Digitalmars-d-learn mailing list