The Issue with Floating Point
Computer Science Level 2In a python REPL environment, we would see the following:
1 2 3 

That is x
is not actually stored as 0.1
. This is because \(\dfrac{1}{10}\) cannot be represented as a finite combination of these:
\[ \dfrac{a_1}{2} + \dfrac{a_2}{2^2} + \dfrac{a_3}{2^3} + \cdots . \]
In other words, there is no corresponding binary fraction for 0.1
.
Which of the following can be expressed without any error as a floating point?
Your answer seems reasonable.
Find out if you're right!
Sign up to access problem solutions.
That seems reasonable.
Find out if you're right!
Already have an account? Log in here.