J C
J C

Reputation: 181

Sage math numerical evaluation

I'm using Sage math to do some calculation where I found the numerical evaluation quite different from that of python's.

For example, the evalf() nolonger works, instead it uses n() and gp().

My questions are:

  1. what are different ways of numerical evaluation in Sage and what's their difference?

  2. what's difference between n() and gp()? why the later seemed to be much slower?

Upvotes: 1

Views: 1196

Answers (1)

kcrisman
kcrisman

Reputation: 4402

I assume you are referring to Sympy when you say evalf. Anyway, n() or numerical_approx() is the equivalent. See the documentation. The default is 53 bits of accuracy.

You shouldn't be thinking of gp() though, unless you really want to use the GP/Pari interpreter or convert something to GP.

Upvotes: 3

Related Questions