Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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?