Friends, some days I simply don't know what we're ...
# thinking-together
w
Friends, some days I simply don't know what we're doing. Open your nearest JavaScript console (or whatever) and observe
350680 / 8813712 * 2203428 == 2203428 * 350680 / 8813712
. I'm sure you all know why this is false. But what can we do in the face of such sandy foundations?
c
Better yet: 0.1 + 0.2 + 0.3 - 0.3 - 0.2 != 0.1
and 0.1 + 0.2 + 0.3 != 0.1 + (0.2 + 0.3)
i
Do like Woz and encode all numbers as fixed precision.
e
IEEE floating point leaves a lot to be desired. We are planning to support Crockford's proposed DEC64 arithmetic, which solves the 0.1 + 0.2 = 0.3 problem. Obviously has huge implications, as the underlying OS uses IEEE floating point.
w
JS is definitely the sandiest of foundations.. there are better ones. But yes, no escaping IEEE when it is what the hardware does
w
Having turned it over a bit more, one of my frustrations is that Aspect Oriented Programming didn't become a standard thing because I would like to be able to tell the compiler, "Okay guys, within the important financial calculation package, let's not use doubles, kthx."