Previous Up Next

5.9.1  Eval a real at a given precision: evalf and Digits, DIGITS

Input:

1+1/2

Output:

3/2

Input:

1.0+1/2

Output :

1.5

Input:

exp(pi*sqrt(20))

Output:

exp(pi*2*sqrt(5))

With evalf, input:

evalf(exp(pi*2*sqrt(5)))

Output:

1263794.75367

Input:

1.1^20

Output:

6.72749994933

Input:

sqrt(2)^21

Output:

sqrt(2)*2^10

Input for a result with 30 digits:

Digits:=30

Input for the numeric value of eπ√163:

evalf(exp(pi*sqrt(163)))

Output:

0.262537412640768743999999999985e18

Note that Digits is now set to 30. If you don’t want to change the value of Digits you may input

evalf(exp(pi*sqrt(163)),30)

Previous Up Next