• Advertisement

# representing .1 in base(2)????

This topic is 2673 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

i understand it's impossible to represent .1 in base(2) but im curious as to WHY exactly?? i know you can keep getting closer and closer to it the further you go into the negative powers of 2, but im wondering what the real reasoning is why you cannot reach it?

#### Share this post

##### Share on other sites
Advertisement
For the same reason you get repeating decimals in decimal arithmetic: eventually the remainder after factoring out a digit repeats. For example, to do the long division in decimal arithmetic for 50/74:
         0.675   74 ) 50.0        44.4          560          518           420           370            500

The initial remainder is the full 50. Subtracting .6 times 74 leaves 5.60. Subtracting .07 times 74 leaves .420. Subtracting 0.005 times 74 leaves 0.050. Now we have a remainder that is the same as the initial value multiplied by a power of 10 from the original. That means we keep repeating the same digits over and over again. Another 6, then another 7, then another 5, until infinity. The same thing happens in binary.

#### Share this post

##### Share on other sites
Quote:
 what the real reasoning is why you cannot reach it?

Because 0.1base10 is not evenly divisable by any inverse power of 2. No matter what small inverse power of 2 you choose, it will not divide into 0.1base10 an exact integer number of times.

E.g., in base 10 (using SiCrane's example), 0.675base10 means six-hundred and seventy-five 1/1000ths, exactly. It can be expressed that way because 0.675 is divisable by 1/1000 without anything left over.

For 0.1base10, there is no equivalent expression for an integer multiple of any inverse power of 2.

EDIT: Perhaps a little more obvious - consider inverting 0.1 and it's binary equivalent.

1/0.1 = 1/binary-equiv

That equation becomes:

10 = some-integer-multiple-of-power-of-2

Simply can't be done.

#### Share this post

##### Share on other sites
Quote:
 Original post by nuclear123i know you can keep getting closer and closer to it the further you go into the negative powers of 2, but im wondering what the real reasoning is why you cannot reach it?

There are only so many bits of precision you can fit into the mantissa. For a 16-bit float, Try out this applet. The mantissa for 0.1base10 is 1001 repeating... See also IEEE-754, Binary32, Binary64.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement
• ### Popular Tags

• Advertisement
• ### Popular Now

• 12
• 10
• 11
• 18
• 13
• Advertisement