I just found out from the Peter Lawreys post that this is a valid expression and evaluates to true .
333333333333333.33d == 333333333333333.3d
My question is why he is allowed to have double literals that cannot be represented in double, and whole literals that cannot be represented are forbidden. What is the rationale for this decision.
Lateral note, I can actually cause a range compilation error for two-word literals :-)
99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999d
So, as long as we are in the range (min, max), the literal is approaching, but, going beyond this, it seems that the compiler refuses to bring it closer.
source share