The Digits Environment Variable - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Evaluation : Digits

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

Digits:=20

(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

Digits:=5

(5)

1.0210

1.2190

(6)

interfacedisplayprecision=5

1

(7)

Digits20

Digits:=20

(8)

aevalf13

a:=0.33333

(9)

a3

1.00000

(10)

See Also

assignment

environment variables

evalf

float

interface

kernelopts

Maple_floats

NextAfter

type[float]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam