On Friday, 14 March 2014 at 16:06:17 UTC, bearophile wrote:
And double.init is a NaN.
Yes, and the reason for this is NaN is similar to null - an invalid state, so it can help you to catch uninitialized variables.
You should explicitly initialize the variables normally and for the cache case, either keep a separate variable to tell if it is initialized (since NaN might be a valid cache state, like how an int may legitimately be 0) or compare using std.math.isNaN.
