> I appreciate that it may be surprising that 0.1 + 0.2 != 0.3 at first, or that many people are not educated about floating point, but I don't understand the people who "understand" floating point and continue to criticize it for the 0.1 + 0.2 "problem."
That's not a calculation that should require a high level of precision.
Decimal fp is still 'wrong' for, say, 1/3 + 1/3 = 2/3.
Maybe we really should move back to base-60 like the Babylonians used, then you could at least divide by 3.
The argument "we want to look at base-10 in the end so it should be the internal representation" is really weak and ignores basically every other practical aspect.
The only example off the top of my head that is floating point is C# "decimal", which actually originates from the Decimal data type in OLE Automation object model (which could be seen in VB6, and can still be seen in VBA):
https://msdn.microsoft.com/en-us/library/cc237603.aspx
Note this bit:
"scale: MUST be the power of 10 by which to divide the 96-bit integer represented by Hi32 * 2^64 + Lo64. The value MUST be in the range of 0 to 28, inclusive."
The reason why it's limited to 28 is because the 96-bit mantissa can represent up to 28 decimal digits exactly. The way it's enforced, any operation that produces a result outside of this range is an overflow error (exception in .NET).
They don't - all 11 bits of the exponent (for float64) are in use, so you can have something like 1e300, and then you can't e.g. add 1 to it and get a different number.
>>> x = 1e100
>>> x
1e+100
>>> y = x + 1
>>> y
1e+100
>>> x - y
0.0 if x != y, x - y != 0
which holds for all x and y, but is different to if dx != 0, x + dx != x
which fails for some (many!) x and dx.9999999999999995.0 – 9999999999999994.0 == 10.0000