4 ms·
Which properties do you mean in particular? The main point is just that finance doesn't necessarily require perfect accuracy. It does when Bob sends Alice $1 an
by bidirectional 6y ago
Which properties do you mean in particular? The main point is just that finance doesn't necessarily require perfect accuracy. It does when Bob sends Alice $1 and their account balances must line up perfectly, it doesn't when you're implementing models which already have greater error than floating point could imbue. Not to mention that decimals, integers and rationals cannot compute something as simple as compound interest without lack of accuracy, so they're not going to save you when you're implementing Black-Scholes.
- lamp987 6y ago>rationals cannot compute something as simple as compound interest without lack of accuracy Care to elaborate?
- bidirectional 6y ago(Continiously) compound(ed) interest is e^(rate * time), e is not a rational number. Transcendental functions are commonly used in financial modelling, and once they appear, nothing short of a full-blown CAS will give you 100% accurate results (not that you should care, because your model is off by more than floating point error).
- lamp987 6y agoi see
- gamache 6y ago> finance doesn't necessarily require perfect accuracy Maybe finance doesn't, but billing does.
- bidirectional 6y agoYes, of course, I said that in my original comment. I'm arguing the advice as a panacea, not saying the OP was wrong to follow it.
- devwastaken 6y agoI mean if you're storing a value of money higher than the accuracy of floating point - how are you handling it? In languages like python you can have numbers of whichever length you want - internally it's breaking up that value into multiple primitive integer or float types I assume. Is that similar to what you do, or are you handling that differently?
- selcuka 6y agoPython has arbitrary precision integers but floats are limited to 64 bits (i.e. the maximum is 1.8e308). Still sufficient for most financial applications though.