Reason for using BCD arithmetic
Doug Gwyn
gwyn at smoke.BRL.MIL
Sun Oct 23 10:40:37 AEST 1988
In article <8810211335.AA19348 at ucbvax.Berkeley.EDU> BBUXEIPD at UIAMVS.BITNET (Robert Pearson) writes:
> You are quite correct that BCD arithmetic has 'roundoff error', as all
>'floating point' representations will have 'roundoff error' if the 'mantissa'
>is exceeded.
That is incorrect. Not all so-called "floating point" schemes have fixed
significand size, and some (including those using variable-length BCD
strings) are able to represent results of arithmetic operations exactly.
A BCD-based one will have problems with division, but that is not usually
commercially significant (whereas the errors introduced by use of normal
flotaing-point hardware is).
More information about the Comp.lang.c
mailing list