|
Prev: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
Next: Decimal versus binary arithmetic was Re: J4 -presentation/discussion on "Future of the COBOL Standard"
From: Clark F Morris on 31 Mar 2008 21:03 On Mon, 17 Mar 2008 21:53:23 -0600, Robert <no(a)e.mail> wrote: >On Tue, 18 Mar 2008 11:33:00 +1300, "Pete Dashwood" <dashwood(a)removethis.enternet.co.nz> >wrote: > >>"Robert" <no(a)e.mail> wrote in message >>news:6dmrt3dn0hueihi3p996d5n96sts0pgtm1(a)4ax.com... > >>> Binary integer arithmetic is 100% accurate. >> >>I know. I once wrote a program for system 360 that used ONLY binary >>arithmetic (no packed). To everyone's amazement, it produced correct printed >>figures... > >The others were confused. They thought binary integer was the same as binary floating >point. That's why IBM was able to sell them decimal hardware. > >>The difference between binary and decimal only >>> shows up when dealing with fractions. Most business applications deal ONLY >>> with integers. >>> Currency amounts are not fractions, they are cents counters. Did you know >>> Cobol allows V >>> in the picture of binary integers? Cobol does the decimal shifting and >>> alignment for you, >>> WITHOUT causing rounding errors. >>> >>> In short, we never needed packed decimal. It was a marketing ploy. As someone who has coded COBOL starting in 1963 and on the IBM 360 (and descendants) from 1966, obviously you don't understand the various problems. >> >>Hmmm... not sure about that. There had been some famous errors with floating >>point and I think that people were looking for the reassurance of fixed >>point arithmetic. > >Binary integer IS fixed point. You're making the same mistake the others made. > >I'm but advocating binary floating point, but I'll point out that Excel uses binary floats >internally. Millions of accountants use Excel. Why do we not hear stories about rounding >errors there? I would like to see the code that actually keeps things straight. Given my opinion of the accuracy of many spreadsheets and the amount of testing done, I don't know if people would know whether they had an error. > >> rest snipped |