Which is the deeper truth? Don't use..
-
-
I think that's fair. My point is that it's not necessarily obvious you're getting burned by FPEP until you're in deep, whereas it's usually clear if a regex isn't returning what you think it should. A lot of F500s have lost a lot of money to very silly FP errors!
-
I've never heard of any such case. Even if you use floats incorrectly, the accumulated error tends to be small.
-
In financial calculations, it's common to iterate over a large number of periods (e.g., mortgages, bond payments, and so on) or a large number of transactions (e.g., all the payroll checks). Adding or subtracting iteratively easily leads to catastrophic cancellations with FPs.
-
For such calculations, when you store back to an integer in every step, you accumulate a much bigger error in total. I don't see how floats would hurt you there in a worse way.
-
The alternative is not "use integers"; it's "use the right tool for the job, which is usually your language's Money or BigDecimal type".
-
If your language has such a thing, this is sane advice.
- 1 more reply
New conversation -
-
-
Not a problem is you build your modules with recursion on the outside of the regexp. (Regexps are for matching words, and typically you want something with a stack to handle the surrounding syntax.)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.