Post Reply 
Bicimal
05-20-2019, 11:07 PM
Post: #3
RE: Bicimal
0.5 is a bad example, since it can actually be represented in finite-precision binary, being 0.1 in that base.

As far as I'm aware, most calculators still work in BCD today, but some calculators and most computers work in binary.

This isn't really a problem in most cases. It is true that 0.2, for example, cannot be represented in finite-precision binary, being 0.001100110011... in that base; but of course lots of numbers can't be represented in finite-precision decimal either, like 1/3, and that doesn't stop anyone from using decimal (BCD) calculators anyway. As long as you are aware of the limits of representation, this is usually not an issue.

I have personally had to deal with representation issues when working with algorithms that use packed storage to combine multiple numbers into one for storage efficiency. For example, on an early HP with 10-digit decimal precision, you could pack five two-digit numbers into one register, like AA.BBCCDDEE for example, and the code to extract CC from that number would be something like 10000 x INT 100 MOD. Running such code on a binary computer could fail because of representation issues, and it would have to be changed to use groups of bits rather than decimal digits; with groups of 7 bits, the aforementioned logic would be 16384 x INT 128 MOD.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Bicimal - Tugdual - 05-20-2019, 10:06 PM
RE: Bicimal - Albert Chan - 05-20-2019, 11:04 PM
RE: Bicimal - Thomas Okken - 05-20-2019 11:07 PM
RE: Bicimal - KeithB - 05-21-2019, 02:06 PM
RE: Bicimal - Paul Dale - 05-22-2019, 08:44 AM
RE: Bicimal - Druzyek - 05-21-2019, 02:30 PM
RE: Bicimal - KeithB - 05-22-2019, 12:58 PM
RE: Bicimal - Tugdual - 05-22-2019, 08:55 PM



User(s) browsing this thread: 1 Guest(s)