4 ms·
A bug in dealing with fixed point numbers that caused a price to be off by a factor of 10^8.
by dahfizz 5y ago
A bug in dealing with fixed point numbers that caused a price to be off by a factor of 10^8.
- uuyi 5y agoOh I had one of them a number of years ago on a well known e-commerce company’s back end ERP. Financial values were stored in int64 with the decimal position offset stored in a byte separately. The library that handled these values was poorly implemented so if you added values with different offset sizes without converting them and checking for overflow possibilities it’d do all sorts of undefined shit. I put a simple assertion in as a precondition check and this fired over 20,000 times within an hour of deploying it leading to several months of fixes, horrible discoveries and cheques written.