Closest number to 1.22

148 Views Asked by At

Given:

1 bit for sign
3 bits for exp
4 bits for fract

How to find the closest floating-point number to 1.22 ??

1

There are 1 best solutions below

0
On

The values of the sign bit and the exponent ought to be obvious. So the only question is what the mantissa ought to be. But there are only 4 bits in the mantissa. So even if you don't know what to try, you could just try all 16 possible mantissas and see which one comes closest.