Skip to main content

Exploring Calculus with Maple Introductory Calculus

Section 7.1 Expressing a Result as a Decimal

Maple tries to use exact, symbolic values whenever it can. If you need a decimal representation of a value or expression, you can use the evalf() command as seen below.

Aside

> sqrt(2);
\begin{equation*} \displaystyle \sqrt{2} \end{equation*}
> evalf(sqrt(2));
\begin{equation*} \displaystyle 1.414213562 \end{equation*}
It is often useful to give the exact value as well as the decimal approximation in one execution group, using the % shortcut:

Aside

> sqrt(2); evalf(%);
\begin{equation*} \displaystyle \sqrt{2} \end{equation*}
\begin{equation*} \displaystyle 1.414213562 \end{equation*}
By default, Maple will express a decimal with \(10\)-digit accuracy. This default can be changed by assigning a new value to Digits, or you can specify the number of digits anytime you use the evalf() command.

Aside

> Digits := 15;
\begin{equation*} \displaystyle \textit{Digits}\, := \,15 \end{equation*}
> Pi;
\begin{equation*} \displaystyle \pi \end{equation*}
> evalf(Pi);
\begin{equation*} \displaystyle 3.14159265358979 \end{equation*}
> evalf(Pi,50);
\begin{equation*} \displaystyle 3.1415926535897932384626433832795028841971693993751 \end{equation*}