3 ms·
> I would argue that financial math by definition needs to be accurate to the penny. Where is "pretty close" financial calculations considered acceptable? Ther
by jmwilson 7y ago
> I would argue that financial math by definition needs to be accurate to the penny. Where is "pretty close" financial calculations considered acceptable?
There is a difference between analysis and accounting. There are many financial models (e.g. Black-Scholes-Merton option pricing) that are analytic in nature and use transcendental functions, so the idea of getting an exact, arbitrary-precision answer is hopeless. Using a decimal type for this kind of computation would be an exercise in slowing down processing by a few orders of magnitude.
- samatman 7y agoThis is an excellent point. When computing around money, you're either working with magnitudes or units. If you don't know which, you're working with units; use a Decimal.
- ncmncm 7y agoIf you are working with units, ordinary binary integers are overwhelmingly better for almost every operation.