The third in a series of blogs covering common mistakes in Database and Application designs for financial calculations.
Order of Operations and Storing Aggregate Results:
When working with float data types, order of operations will affect the ending value.
Consider 3:
Python3:
justin@Debian10:~$ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
>>> (1234.567 * 3.333333) + (1.234567 * 3.333333)
4119.338,144,732,812
>>> (1234.567 + 1.234567 ) * 3.333333 …