Opened 9 years ago

Last modified 5 years ago

#13039 new defect

improve mpmath-to-sage conversion — at Version 5

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

Description (last modified by mkoeppe)

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:

from sage.libs.mpmath import utils as mpmath_utils 
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 (5)

comment:1 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:2 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:3 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:4 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:5 Changed 5 years ago by mkoeppe

  • Description modified (diff)
  • Milestone changed from sage-6.4 to sage-7.4
Note: See TracTickets for help on using tickets.