The Digits Environment Variable
Calling Sequence
Parameters
Description
Examples
Digits := n
n
-
natural number
The Digits environment variable controls the number of digits that Maple uses when making calculations with software floating-point numbers.
The default value of Digits is 10. The value of Digits is changed by using the assignment operator.
Maple fully evaluates environment variables such as Digits in all contexts. Because Digits is an environment variable, any assignments to it inside a procedure body are undone upon exit from the procedure.
The maximum value of Digits is obtained from kernelopts(maxdigits).
The interface(displayprecision) command controls the number of decimal places to be displayed, which is determined by Digits. This allows for simplification of display without introducing round-off error.
Digits≔20
f := proc() print( "Entering f. Digits is", Digits ); Digits := Digits + 17; print( "Adding 17 to Digits yields", Digits ); end proc:
f⁡
Entering f. Digits is,20
Adding 17 to Digits yields,37
Digits
20
When returning from f in the procedure above, Maple resets Digits to its value on entry.
1.0210
1.2189944199947571302
Digits≔5
1.2190
interface⁡displayprecision=5
−1
a≔evalf⁡13
a≔0.33333
a⋅3
1.00000
See Also
assignment
environment variables
evalf
float
interface
kernelopts
Maple_floats
NextAfter
type/float
Download Help Document