Opened 9 years ago

Last modified 5 years ago

#13039 new defect

improve mpmath-to-sage conversion — at Initial Version

Reported by: dsm Owned by: jason, jkantor
Priority: major Milestone: sage-7.4
Component: numerical Keywords: sd40.5
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


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:, 1e2)
sage:, 1e4)
sage:, 1e8)
sage:, 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/ in (sage/libs/mpmath/utils.c:5667)()

/Users/mcneil/sagedev/sage-5.1.beta0/local/lib/python2.7/site-packages/sage/libs/mpmath/ 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/ 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).

Change History (0)

Note: See TracTickets for help on using tickets.