Skip to main content
Contents Index
Dark Mode Prev Up Next
\(\usepackage{siunitx}
\newcommand{\lrp}[1]{\left(#1\right)}
\newcommand{\lrb}[1]{\left[#1\right]}
\newcommand{\lrbrace}[1]{\left\lbrace#1\right\rbrace}
\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\dint}{\displaystyle\int}
\newcommand{\defint}[2]{\dint^{#2}_{#1}}
\newcommand{\dlim}[2]{\displaystyle\lim_{#1\rightarrow #2}\,}
\newcommand{\dydx}{\dfrac{dy}{dx}}
\newcommand{\ddx}{\tfrac{d}{dx}}
\newcommand{\dddx}{\dfrac{d}{dx}}
\newcommand{\ifsol}[1]{\ifprintanswers{#1}\fi}
\newcommand{\Nat}{\mathbb{N}}
\newcommand{\Whole}{\mathbb{W}}
\newcommand{\Int}{\mathbb{Z}}
\newcommand{\Rat}{\mathbb{Q}}
\newcommand{\Real}{\mathbb{R}}
\newcommand{\Complex}{\mathbb{C}}
\DeclareMathOperator\arcsinh{arcsinh}
\DeclareMathOperator\arccosh{arccosh}
\DeclareMathOperator\arctanh{arctanh}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\newcommand{\sfrac}[2]{{#1}/{#2}}
\)
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 Maple will default to a decimal approximation anytime the input already uses decimals. For example, try
sqrt(2.0) and see the result.
\begin{equation*}
\displaystyle \sqrt{2}
\end{equation*}
\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 Recall that using the
% symbol within another command will use the result of the first command automatically.
\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 The first letter of
Digits must be capitalized and the assignment operator
:= is used to assign a value for the desired accuracy. The assignment operator
:= is explained in detail in
The Assignment Operator and Defining Functions .
\begin{equation*}
\displaystyle \textit{Digits}\, := \,15
\end{equation*}
\begin{equation*}
\displaystyle \pi
\end{equation*}
\begin{equation*}
\displaystyle 3.14159265358979
\end{equation*}
\begin{equation*}
\displaystyle 3.1415926535897932384626433832795028841971693993751
\end{equation*}