# Decimal to Binary

1. Jul 22, 2004

### x_endlessrain_x

hi!

does anybody know how to convert a fraction(deciaml) to Binary?

for example how can we convert 0.16 to Binary?

thx for helping

2. Jul 22, 2004

### AKG

In a similar way you'd do for numbers > 0.

If we have 200, we can start by finding the largest power of 2 less than or equal to 200, namley 128, and we have 72 remaining. The largest power of 2 less than or equal to 72 is 64, with 8 remaining. The largest power of 2 less than or equal to 8 is 8, with zero remaining. With zero remaining, we stop. So, we have
1x128 + 1x64 + 0x32 + 0x16 + 1x8 + 0x4 + 0x2 + 0x1. In binary:
11001000.

Do the same for 0.16. The greatest power of 2 less than 0.16 is $2^{-3} = 1/8 = 0.125$. This leaves 0.035 remaining. You might find yourself with a non-terminating binary representation. To start, you'll have 0.001... (I haven't figured out what will replace the "...", that's your job ;)).

3. Jul 22, 2004

### x_endlessrain_x

ok,i got it ! thx

4. Jul 22, 2004