4 ms·
How did you handle the properties of floating point? The reason people recoil at that more than likely has to do with lack of knowledge in how floats are wrangl
by devwastaken 6y ago
How did you handle the properties of floating point? The reason people recoil at that more than likely has to do with lack of knowledge in how floats are wrangled to ensure they're accurate.
- stevesimmons 6y agoWhich properties? For front-office risk and pricing calcs, speed of calculation matters most. Hence IEEE754 float64. Fixed precision decimals really only matter for middle and back-office, for trade confirmation and settlement.
- tantalor 6y agoWhat's the difference between front/middle/back office?
- arthurcolle 6y agoIn the context of a bulge bracket investment bank, it's basically like this: Front office - S&T (sales & trading), i.e. revenue generating activity. Usually includes any quants/quant developers actively working on things that make money Middle office - operations. handles settlements, confirms, and generally anything related to the post-trade flow that is "after the trade is booked" Back office - accounting, legal, engineering, IT support, HR. Anything that isn't a revenue center that also isn't even tangentially facing revenue generating operations
- bidirectional 6y agoWhich 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 ago