You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sage: round(sqrt(Integer('1'*500)))
------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
File "/Users/robert/sage/current/local/lib/python2.5/site-packages/sage/misc/functional.py", line 865, in round
except AttributeError: return RealDoubleElement(__builtin__.round(x, 0))
File "/Users/robert/sage/current/local/lib/python2.5/site-packages/sage/calculus/calculus.py", line 6164, in __float__
return float(f._approx_(float(g)))
File "/Users/robert/sage/current/local/lib/python2.5/site-packages/sage/calculus/calculus.py", line 7941, in _approx_
return math.sqrt(x)
OverflowError: math range error
Actually, I don't know of a good reason that "always return as RDF" is enforced. It seems like floor, round, and ceiling should return Integers where possible. There is a trac ticket by Nick Alexander that does this for some objects.
Approx should fall back to mpfr if float fails.
Component: calculus
Issue created by migration from https://trac.sagemath.org/ticket/4266
The text was updated successfully, but these errors were encountered: