Background : I am a freshman. I just entered college 3 weeks ago and one of the topic is about numbers. We learn about decimals, binary, hexadecimal, octal, floating point, and so on.
In floating point, the professor explained that the float is stored at 32 bits. With the following specs.
1 bit - sign
7 bits - the exponent(excess 31) (bias)
24 bits - fraction
For example if we're looking at
0 0000001 000000000000000000000001
Then:
Sign -> 0 is positive
Exponent -> 1-31 = 2^(-30)
So the result is
1.000000000000000000000001 x 2^(-30)
correct?
My question:
- At one point, something should translate the binary to decimals right? How do the computer store the decimals behind the floating point.
I mean, if I were the programmer, I would create an array of 256 numbers to store the number behind the decimal point. 0 to 9 only takes 4 bits.
If my if-I-were-a-programmer is correct, then why floating precission error comes at a very early place? I mean, given the existance of irrational number, there's no question that a precission error should come somewhere, but I would expect floating precession error comes at 256th number behind coma.
Can you recommend extra reading material on this topic?
I tried to read this, it talks about error of summation (understandable), the conversion, but didn't really talk about the program who did the conversion. Is this compiler specific?
Thanks =D