|
![](/i/fill.gif) |
Warp wrote:
> Besides, 1/10 isn't an integer, so what would BCD integer registers
> help that?
It's a scaled integer. Part of the decimal math mechanism includes aligning
the decimal points.
> Any solution you devise will also work with plain binary
> registers as well.
Yes, and so would floating point, if you made the registers big enough.
And, like floating point, it would be quite the PITA to translate scaled
integer numbers into something you could print efficiently, compared to
using BCD.
COBOL has "display" types (packed BCD) and "computation" types (two's
complement integers), depending on what you want to do with them.
Why would plain integers be *better* than packed BCD for this sort of
application? You're going to need specialized instructions if you want to
run fast in either situation.
--
Darren New, San Diego CA, USA (PST)
C# - a language whose greatest drawback
is that its best implementation comes
from a company that doesn't hate Microsoft.
Post a reply to this message
|
![](/i/fill.gif) |