On Wed, Sep 8, 2010 at 3:03 PM, Greg Marks <[email protected]> wrote:
> It sounds like a C program using MPFR (http://www.mpfr.org)
> would do what you want. As MPFR is built into SAGE, you might
> perhaps find it more convenient to invoke MPFR within SAGE.
This is what I would recommend. You can do something like
from sage.rings.real_mpfr cimport *
def square(RealNumber x):
cdef RealNumber result = x._new()
mpfr_mul(result.value, x.value, x.value, GMP_RNDN)
return result
If you really need speed, you can declare, allocate, and free mpfr_t
variables themselves (declared via "cdef mpfr_t var") rather than
using the RealNumber Python objects as wrappers.
Just out of curiosity, what multi-precision root finding tools are you
using? Also, I don't think numpy supports high-precision floating
point arrays (except as arrays of generic objects).
- Robert
--
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-support
URL: http://www.sagemath.org