numerical_approx() weirdness?
Hi all:
I recently discovered that the numerical_approx() function (aliased as n()) does not perform as i expected. Is the following behavior intentional?
sage: x = pi.n(digits=3)
sage: print x, x.n(), QQ(x), QQ(x).n()
3.14 3.14160156250000 333/106 3.14150943396226
Where are the extra digits of x
coming from to produce the last three results in the output above?
Let me elaborate. I expected that `x` = 3.14, so that `x.n()` = 3.14000000000000 and `QQ(x)` = 157/50. But `x == 3.14` returns `False`, `x.n()` = 3.14160156250000 and `QQ(x)`= 333/106. Huh? Why are there more than 3 digits stored in x?
Thanks for the clarification!