See http://trac.sagemath.org/sage_trac/ticket/4266

On Oct 10, 2008, at 4:14 PM, mabshoff wrote:

>
>
>
> On Oct 10, 4:04 pm, john_perry_usm <[EMAIL PROTECTED]> wrote:
>> Try adding another 1. Apparently I copied & pasted the wrong one.
>>
>
> I can reproduce it on a 64 bit box:
>
> sage:
> round(sqrt 
> (111111111111111111111111111111111111111111111111111111111111111111111 
> 1111111111111111111111111111111111111111111111111111111111111111111111 
> 1111111111111111111111111111111111111111111111
> 1111111111111111111111111111111111111111111111111111111111111111111111 
> 111111111111111111111111111111111111111111111111111111))
> 1.05409255339e+154
> sage:
> round(sqrt 
> (111111111111111111111111111111111111111111111111111111111111111111111 
> 1111111111111111111111111111111111111111111111111111111111111111111111 
> 1111111111111111111111111111111111111111111111
> 1111111111111111111111111111111111111111111111111111111111111111111111 
> 1111111111111111111111111111111111111111111111111111111))
> ---------------------------------------------------------------------- 
> -----
> OverflowError                             Traceback (most recent call
> last)
>
> /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/<ipython console> in
> <module>()
>
> /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/local/lib/python2.5/
> site-packages/sage/misc/functional.pyc in round(x, ndigits)
>     845     else:
>     846         try: return x.round()
> --> 847         except AttributeError: return
> RealDoubleElement(__builtin__.round(x, 0))
>     848
>     849 def quotient(x, y, *args, **kwds):
>
> /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/local/lib/python2.5/
> site-packages/sage/calculus/calculus.pyc in __float__(self)
>    6201         f = self._operands[0]
>    6202         g = self._operands[1]
> -> 6203         return float(f._approx_(float(g)))
>    6204
>    6205     def _fast_float_(self, *vars):
>
> /scratch/mabshoff/release-cycle/sage-3.1.3.rc0/local/lib/python2.5/
> site-packages/sage/calculus/calculus.pyc in _approx_(self, x)
>    7978
>    7979     def _approx_(self, x):
> -> 7980         return math.sqrt(x)
>    7981
>    7982 sqrt = Function_sqrt()
>
> OverflowError: math range error
>
> The issue seems to be that RealDoubleElement() cannot deal with a
> value that large since it overflows the range that float provides.
>
> Cheers,
>
> Michael
> >


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to