evalf with two arguments

Messages in english

Modérateur : xcasadmin

belanger
Messages : 63
Inscription : jeu. juil. 27, 2017 3:26 pm

evalf with two arguments

Message par belanger » ven. août 31, 2018 3:21 am

In the French manual (https://www-fourier.ujf-grenoble.fr/~pa ... tml#sec161) it discusses the connection between the number of displayed digits, the number of stored digits, the value of Digits and the second argument of evalf.

One example says that with Digits equal to 7,
In: evalf(sqrt(2),3)
will display
Out: 1.41
but be stored as 1.414, as shown by
In: evalf(sqrt(2),3) - 1.414214
resulting in
Manual out: -0.000214
However, with Digits equal to 7, although
In: evalf(sqrt(2),3)
does display
Out: 1.41,
evaluating (with the latest version)
In: evalf(sqrt(2),3) - 1.414214
results in
Actual out: -0.004214
so evalf(sqrt(2),3) is really 1.41

Also, with Digits still equal to 7, it shows that
In: evalf(sqrt(2),10) will display as
Out: 1.414214
since the display depends on Digits, not 10. And evalf(sqrt(2),10) does just show the 7 digits
1.414214, but
In: evalf(sqrt(2),20)
will display 20 digits
Out: 1.4142135623730950488.

I'm thinking that maybe the handling of evalf has changed since the manual was written, but what are the new rules?

Jay

parisse
Messages : 5882
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: evalf with two arguments

Message par parisse » ven. août 31, 2018 8:01 am

Probably yes, we need to fix the manual. I think that's beacuse evalf was using n digits after the decimal point (like round) and is now using a total number of digits, which is more consistent.
Longfloats display does not depend on Digits.

Répondre