int funct (int x)
{
if (x <= 2) {
return x;
} else {
int a = funct( x - 1 );
int b = funct( x - 3 );
return a + b;
}
}
main ()
{
int i;
for (i = 1; i < 8; i++) {
printf("%d", funct( i ) );
}
}
_ _ _ _ _ _ _ _ _ _ _
|_|_|_|_|_|_|_|_|_|_|_|
| | | |
s exp mantissa
s = the sign bit for the mantissa; 0 is positive
exp = the biased exponent, between -8 and +7
mantissa = the fixed point binary mantissa, between 0 and .5
For all integer x between 1 and 10, what is the closest approximation of
the value of 1/x in this floating point number system? Show your results
in binary, and show the error, as a decimal number.