The Rounding Environment Variable
Calling Sequence
Parameters
Description
Examples
Rounding := x
x

one of 0, nearest, infinity, infinity, simple
The Rounding environment variable controls the rounding of floatingpoint results.
There are five rounding modes available in Maple.
Rounding Mode
Meaning
nearest
round to the nearest possible value,
with ties resolved by rounding to the nearest even
0
round towards zero
infinity
round towards positive infinity
infinity
round towards negative infinity
simple
with ties resolved by rounding up
The value of Rounding is changed by using the assignment operator. The default value of Rounding is nearest.
To determine the current value of Rounding during a Maple session, enter the command Rounding;.
The rounding mode determines the sign of 0 when it cannot be obtained otherwise.
Infinities always round to themselves, independent of the rounding value.
Maple fully evaluates environment variables such as Rounding. Because Rounding is an environment variable, any assignments to it inside a procedure body are undone upon exit from the procedure.
$\mathrm{Rounding}$
${\mathrm{nearest}}$
f := proc() print( "Entering f. Rounding is", Rounding ); Rounding := infinity; print( "The current value of Rounding is", Rounding ); end proc:
$f\left(\right)$
${''Entering\; f.\; Rounding\; is''}{,}{\mathrm{nearest}}$
${''The\; current\; value\; of\; Rounding\; is''}{,}{}{\mathrm{\infty}}$
When returning from f in the procedure above, Maple resets Rounding to its value on entry to f.
${1.4}^{10}$
${28.92546550}$
$\mathrm{Rounding}\u22540$
${\mathrm{Rounding}}{\u2254}{0}$
${28.92546549}$
$\mathrm{Rounding}\u2254\mathrm{nearest}$
${\mathrm{Rounding}}{\u2254}{\mathrm{nearest}}$
$2.2.$
${0.}$
$\mathrm{Rounding}\u2254\mathrm{\infty}$
${\mathrm{Rounding}}{\u2254}{}{\mathrm{\infty}}$
${\mathrm{0.}}$
See Also
assignment
Default0
environment
float
last_name_eval
round
type/infinity
type[float]
Download Help Document
What kind of issue would you like to report? (Optional)