Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Arbitrary precision rationals increase in storage and processing time each time you multiply them

Only if you store the arbitrary precision number. Last I checked you can't actually have a tenth of a cent, so it has to be rounded at some point. Like when you store it. I was advocating calculation be done with arbitrary precision numbers which do not have this problem.

> Fixed-point arithmetic

This is a decent solution as long as you have enough precision and a strategy for detecting lost cents.

> Floating point arithmetic

Which is non-deterministic based off of optimization level and hardware. Waits for the bank to switch to a new cluster and watch all of their numbers change for the lols. No wonder banks don't know how much money they have.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: