Digits - Maple Help

Online Help

All Products    Maple    MapleSim


The Digits Environment Variable

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Digits := n

Parameters

n

-

natural number

Description

• 

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.

Examples

Digits20

Digits20

(1)

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

(2)

Digits

20

(3)

When returning from f in the procedure above, Maple resets Digits to its value on entry.

1.0210

1.2189944199947571302

(4)

Digits5

Digits5

(5)

1.0210

1.2190

(6)

interfacedisplayprecision=5

−1

(7)

Digits20

Digits20

(8)

aevalf13

a0.33333

(9)

a3

1.00000

(10)

See Also

assignment

environment variables

evalf

float

interface

kernelopts

Maple_floats

NextAfter

type/float