News for hackers. Stuff that matters.
Re:0.30000000000000004 by blowski on Tuesday December 03, 2019 @03:52AM (#21690897)
I like this approach. Is it compatible with the parent comment?
Re:0.30000000000000004 by zelly on Tuesday December 03, 2019 @10:42AM (#21693276)
Yes, the parent approach is the same thing but with a decimal point added for convenience. The main thing is that the scale is fixed; it is effectively an integer count of 1s of the least significant index. It is impossible to truncate values or round upward and create money that didn't exist. This makes it perfect for representing actual money.