3 ms·
My day job is high performance financial model implementation. Floats storing dollar amounts are the norm for predictions. Operating on values that are linear c
by ehvatum 7y ago
My day job is high performance financial model implementation. Floats storing dollar amounts are the norm for predictions. Operating on values that are linear combinations of integer fractions multiplied by irrational constants (such as Euler’s number) is perfectly possible, but it’s much more performant to be aware of floating point epsilon when writing modeling code.
- nothrabannosir 7y agoI stand corrected, thanks for this example.
- TeMPOraL 7y agoFinancial models are predictive, they don't have to be accurate to a penny, right? Unlike processing actual money people own. (I do some work with predictive simulations about money, but outside finance, and there we care that the result has accurate order of magnitude. Floats were used extensively in the project; I actually upgraded them to doubles for the sake of handling larger order of magnitude spans.)
- ehvatum 7y agoThat’s right. The trading desk also uses floats for analysis and regulatory reporting. Actual account balances come through an API that gives us floats, but rumor has it that it’s backed by Hollerith a punch card library maintained by cybernetic undead, encoded in 1215-EBCDIC-BLACKTONGUE.
- deleted 7y ago[deleted]