Search code examples
binarydiscrete-mathematics

Converting a decimal number x > 1 with n decimals to binary (for example: 70,5)


For homework I am to convert a decimal number to binary. This is usually pretty easy, but I have no idea how to it with a number like 70,5. I know that there is the multiplication algorithm for x < 1, but here, x > 1. I was thinking about maybe writing 70,5 as a sum of numbers that are < 1, then find the binary expressions of these and take the sum. But I'm not sure this is the right approach.

Any ideas?


Solution

  • I found out how to do it!! Just find the binary of 70 (1000110), the binary of .5 (.1) and put them together like 1000110.1 :D