This has a very simples solution. You have to treat the integer part separately from the decimal part.
Therefore, you simply convert the integer part (10) to binary, which becomes 1010.
Let's work with the decimal part of the number (0.5):
We get the decimal part and multiply it by our number system base, which is 2, the amount of times correspondent to our desire of decimal places for the number.
0.5 x 2 = 1.0
Since we only want one decimal place, we stop right now. We obtained the number 1.0, which is the same as 1, the number for the decimal binary.
10.5 = 1010.1 in binary. In byte representation: 1010.1000
Chat with our AI personalities