next up previous contents index
suivant: Numerical algorithms monter: Numerical computations précédent: Difference between the representation   Table des matières   Index


Approx. evaluation : evalf approx and Digits

evalf or approx evaluates to a numeric approximation (if possible).
Input :
evalf(sqrt(2))
Output, if in the cas configuration (Cfg menu) Digits=7 (that is hardware floats are used, and 7 digits are displayed) :
1.414214
You can change the number of digits in a commandline by assigning the variable DIGITS or Digits. Input :
DIGITS:=20
evalf(sqrt(2))
Output :
1.4142135623730950488
Input :
evalf(10^-5)
Output :
1e-05
Input :
evalf(10^15)
Output :
1e+15
Input :
evalf(sqrt(2))*10^-5
Output :
1.41421356237e-05



giac documentation written by Renée De Graeve and Bernard Parisse