4 ms·
I work in Finance, I don't use float, and I suggest you never do either.
by segmondy 8y ago
I work in Finance, I don't use float, and I suggest you never do either.
- chrisseaton 8y agoAs a concrete example, someone was running a massive online FFI for predicting the value of derivatives, and they were doing it in the real domain and using doubles on GPUs for monetary values. Where they doing it 'wrong' then? I don't know much about finance myself.
- frabert 8y agoIf you are predicting, chances are you don't care about all the decimals being correct and you'd rather get the result quickly.
- jimktrains2 8y agoPredicting a value is not the same as accounting.
- deleted 8y ago[deleted]
- OskarS 8y agoI think the problem here is that "financial computing" is too broad a term to apply a rule like that blindly. If you're making products like point-of-sale systems, ecommerce applications or account management, then it's basically malpractice to use floating point. The performance edge you get from them is so slight in the overall performance of the system and the damage bugs cause can be catastrophic. And it's very easy to get them wrong. It's pretty trivial in most languages to swap in decimal and/or rational types, so NOT doing so is just irresponsible. However, if you're doing things like high-frequency trading systems or machine learning stuff with massive amounts of data, then performance really does matter, and using floating point is entirely reasonable. If you're making systems like that, you're hopefully aware of the limitations of floating point and know how to use them safely.
- dragonwriter 8y agoPredicting is inherently approximate; accounting needs to be exact. They may use similar units, but they are different kinds of problems.
- twic 8y agoI work in finance, and i use floats (well, doubles) all the time! I never use floats for any quantities which i need to exactly add up to a known total, of course.