File: exponent.tex

package info (click to toggle)
sollya 8.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,540 kB
  • sloc: ansic: 124,655; yacc: 7,543; lex: 2,440; makefile: 888; cpp: 77
file content (33 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
\subsection{exponent}
\label{labexponent}
\noindent Name: \textbf{exponent}\\
\phantom{aaa}returns the scaled binary exponent of a number.\\[0.2cm]
\noindent Library name:\\
\verb|   sollya_obj_t sollya_lib_exponent(sollya_obj_t)|\\[0.2cm]
\noindent Usage: 
\begin{center}
\textbf{exponent}(\emph{x}) : \textsf{constant} $\rightarrow$ \textsf{integer}\\
\end{center}
Parameters: 
\begin{itemize}
\item \emph{x} is a dyadic number.
\end{itemize}
\noindent Description: \begin{itemize}

\item \textbf{exponent}(x) is by definition 0 if $x$ is one of 0, NaN, or Inf.

\item If \emph{x} is not zero, it can be uniquely written as $x = m \cdot 2^e$ where
   $m$ is an odd integer and $e$ is an integer. \textbf{exponent}($x$) returns $e$. 
\end{itemize}
\noindent Example 1: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> a=round(Pi,20,RN);
> e=exponent(a);
> e;
-17
> m=mantissa(a);
> a-m*2^e;
0
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{mantissa} (\ref{labmantissa}), \textbf{precision} (\ref{labprecision})