#13039: improve mpmath-to-sage conversion
-------------------------+--------------------------------------------------
Reporter: dsm | Owner: jason, jkantor
Type: defect | Status: new
Priority: major | Milestone: sage-5.1
Component: numerical | Keywords: sd40.5
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-------------------------+--------------------------------------------------
Conversions between mpmath and sage objects don't always go smoothly when
the number of digits required for the exponent is very large. This can
cause problems for limiting behaviour when mpmath is used as the numerical
backend for various special functions. For example:
{{{
sage: mpmath_utils.call(mpmath.airyai, 1e2)
2.63448215208818e-291
sage: mpmath_utils.call(mpmath.airyai, 1e4)
6.24874575695894e-289532
sage: mpmath_utils.call(mpmath.airyai, 1e8)
0.000000000000000
sage: mpmath_utils.call(mpmath.airyai, 1e16)
---------------------------------------------------------------------------
OverflowError Traceback (most recent call
last)
/Users/mcneil/sagedev/sage-5.1.beta0/devel/sage-hack/sage/<ipython
console> in <module>()
/Users/mcneil/sagedev/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/libs/mpmath/utils.so in sage.libs.mpmath.utils.call
(sage/libs/mpmath/utils.c:5667)()
/Users/mcneil/sagedev/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/libs/mpmath/utils.so in
sage.libs.mpmath.utils.mpmath_to_sage (sage/libs/mpmath/utils.c:4420)()
/Users/mcneil/sagedev/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/libs/mpmath/utils.so in
sage.libs.mpmath.utils.mpfr_from_mpfval (sage/libs/mpmath/utils.c:3701)()
OverflowError: Python int too large to convert to C long
}}}
This should probably return zero instead (and similarly go to an inf in
the other case).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13039>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.