4 ms·
Floating point is bad as null are, and is defended by the same apologist of null: "I don't make mistakes... so is good!". Floating point ARE a major source of
by mamcx 6y ago
Floating point is bad as null are, and is defended by the same apologist of null: "I don't make mistakes... so is good!".
Floating point ARE a major source of errors across everyone that use them. ARE infectious. ARE semantically wrong. ARE not made for financial calculation.
ARE WRONG.
Period. Just because under a lot of discipline (or luck, or just "assume" is working but nobody have checked, or work before but how knows if today?) not make it a good choice for financial/money.
Is the same error when people think old String types can be used in the unicode world, instead of have a proper type for that.
Luck help a lot. But is not something to be proud about.
- bidirectional 6y agoWell no, the key difference between null and floating point is that for all its flaws, floating point is by far the fastest way of doing non-integer numerical computation. Null is just an ugly convenience hack of arguable merit, floats are fundamental. They're not a major source of error when you're implementing a model which is already inexact to a far larger degree than the problems caused by floats. Black-Scholes does not perfectly price an option, your bootstrapped curve is not a perfect predictor of market conditions in 28 years time. These are the problems faced in front-office finance, the error is already so far beyond 1 + 0.1 not perfectly matching 1.1 that it's not worth caring about. I've worked on applications where users just wanted to see numbers to the nearest 100k so they could model out a few trades they planned to make over the phone. When you're working on a retail banking app where you need to track customer's balances, or an accounting system, or anything like that, then sure, floating point would be malpractice. That is nothing like any of the applications I've worked on in the financial field.
- cameronh90 6y agoFinance isn't just banking and accounting. A huge amount of finance is modelling, simulations, signal generation, etc. where being fast is often way more important than being completely 100% accurate. In financial modelling, errors from floating point are going to be insignificant compared to all the other assumptions you make in your models. I have worked in finance for my entire career, and everyone uses floating point arithmetic for dealing with money on the modelling side (sometimes $0.01 = 1.0, sometimes $1 = 1.0, depends on the institution/currency/convention/context, but we have to deal with fractional money anyway). They do NOT use it on the accounting/back office side. That would be a spectacularly bad idea. Those systems are designed for accuracy to the penny.