electroRF
Member
hi,
I'd appreciate your help
You're given a decimal number, i.e. 0.625, and you need to either:
- print its binary represenation
OR
- print ERROR if it can't be represeneted in binary
How can you tell if a number can't be represented in binary?
for example, 0.625 can be represented in binary : 1 / 2^1 + 1 / 2^3
But, 0.1 can't.
Thank you.
I'd appreciate your help
You're given a decimal number, i.e. 0.625, and you need to either:
- print its binary represenation
OR
- print ERROR if it can't be represeneted in binary
How can you tell if a number can't be represented in binary?
for example, 0.625 can be represented in binary : 1 / 2^1 + 1 / 2^3
But, 0.1 can't.
Thank you.