Convert Decimal to Binary - Get Help Here

  • Thread starter Thread starter x_endlessrain_x
  • Start date Start date
  • Tags Tags
    Binary
AI Thread Summary
To convert a decimal fraction like 0.16 to binary, start by identifying the largest power of 2 that is less than the decimal value. For 0.16, the largest power is 2^{-3} (0.125), leaving a remainder of 0.035. The binary representation begins with 0.001, but may result in a non-terminating sequence. Resources like the IEEE floating point standard can provide further guidance on binary conversions. Understanding these principles is essential for accurate decimal to binary conversion.
x_endlessrain_x
Messages
11
Reaction score
0
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
 
Mathematics news on Phys.org
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 ;)).
 
ok,i got it ! thx
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Back
Top