News for hackers. Stuff that matters.
Re:A little thing to love about Perl 6 and COBOL by reikonomusha on Thursday February 05, 2015 @04:32AM (#9002388)
Base-2 is a problem in accounting because the written value doesn't always actually numerically equal what's being represented internally. With decimal, you don't have that problem, because we write in decimal.

The bigger problem however is how precision is "managed" with floats, which leads to things like non-associativity of operations.

Re:A little thing to love about Perl 6 and COBOL by upofadown on Thursday February 05, 2015 @08:15AM (#9003026)
The article suggested hardware BCD (packed decimals) was superior to floating point. That is true but not for the reason stated. The reason old time BCD was better was simply because they were treated at counting numbers (integers). If you use binary integers you get all of the same advantages with none of the serious headaches of BCD.
Re:A little thing to love about Perl 6 and COBOL by inglor on Thursday February 05, 2015 @05:03AM (#9002469)
Yes, but the way we write decimals doesn't represent numbers very easily, for example 10/3 can't be represented accurately with finite length decimals (but can with rationals)
Re:A little thing to love about Perl 6 and COBOL by ricardobeat on Thursday February 05, 2015 @06:50AM (#9002751)
Thus you'll never see anything being sold for "a third of a dollar". Accounting and finance have specific rules for rounding these, which can then be replicated with precision.