Ask Your Question
1

error with mpmath.findroot on 8.9

asked 2020-01-13 14:56:15 +0200

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.

edit retag flag offensive close merge delete

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 ( 2020-01-14 11:57:29 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-01-14 12:02:49 +0200

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

indeed it seems to be a Python3 issue.

edit flag offensive delete link more

Comments

1

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

eric_g gravatar imageeric_g ( 2020-01-14 19:33:24 +0200 )edit

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: 2020-01-13 14:55:44 +0200

Seen: 234 times

Last updated: Jan 14 '20