First time here? Check out the FAQ!

Ask Your Question
1

error with mpmath.findroot on 8.9

asked 5 years ago

nouret gravatar image

I have ubuntu 18.04 and sage 8.9 with python3. I set:

import mpmath
mpmath.mp.prec = 10000

and I am trying solve

mpmath.findroot(lambda x: x^2 - 3, 100)

then I have an error, end of messege:

/home/nouret/SageMath/local/lib/python3.7/site-packages/mpmath/libmp/libintmath.py in numeral_python(n, base, size, digits)
156     # Divide in half
157     half = (size // 2) + (size & 1)

--> 158     A, B = divmod(n, base**half)
    159     ad = numeral(A, base, half, digits)
    160     bd = numeral(B, base, half, digits).rjust(half, "0")

SystemError: <built-in function divmod> returned a result with an error set

With prec less then 800+ change I have no error, but I need big precision.

Preview: (hide)

Comments

It's OK with the Python 2 version of SageMath 8.9. So it is most probably a Python2 -> Python3 issue.

eric_g gravatar imageeric_g ( 5 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 5 years ago

Reported on https://github.com/fredrik-johansson/...

indeed it seems to be a Python3 issue.

Preview: (hide)
link

Comments

1

For reference: the issue is now tracked at https://trac.sagemath.org/ticket/29009.

eric_g gravatar imageeric_g ( 5 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 5 years ago

Seen: 282 times

Last updated: Jan 14 '20