4 ms·
Many domains, from gas stations to stock markets, require sub-penny pricing.
by mayoff 14y ago
Many domains, from gas stations to stock markets, require sub-penny pricing.
- niggler 14y agoIf sub-penny pricing is needed, usually myridollars (10^-4) suffice. Your example requires millidollars. I'm curious if there's a natural use case requiring sub-myri resolution.
- btilly 14y agoSecuritized bonds present many such cases. The idea is that you have income for each loans, which then pay into bonds based on whatever rules may have been set. These rules often have terms like a fixed interest on the outstanding principal for senior bond issues, and then various divisions for the junior, with a weird "IO" piece that gets the leftovers that don't divide neatly. The rules can be anything that they were structured to be. The result surprisingly frequently is something where the allocation of the final penny in billions of dollars can be impacted by floating point ambiguity. (And the prospectus seldom will clarify this - the ultimate control lies in whatever the servicer's computer program does.)
- ricardobeat 14y agoHopefully we won't see billions of dollars being handled in javascript.
- niggler 14y agoEven with securitized bonds, myridollars are sufficient to represent the payments.
- btilly 14y agoDo not confuse "unambiguous" with "correct". If you use myridollars and the servicer used floating point with roundoff errors, the servicer's implementation is by definition correct.
- niggler 14y agoAll of the interchange formats that I can think of at 1 AM (including FIX and exchange-proprietary formats) are very specific regarding the data. For example, the FIX floating point specifically limits the number of significant figures to 15
- Daniel_Newby 14y agoMinor electronic components like surface mount capacitors have tiny prices. I just looked up a model that costs $0.00745. EDIT: Millage taxes on property are denoted in mills—thousandths. The taxes are often fractional mills, like 2.225. So you need 10^-8 resulution at the least.
- dietrichepp 14y agoI'm guessing those capacitors are sold by the reel, maybe 4,000 to the reel.
- Daniel_Newby 14y agoYes.