\Header{Machine}{Machine Characteristics}
\alias{.Machine}{Machine}
\keyword{sysdata}{Machine}
\keyword{programming}{Machine}
\keyword{math}{Machine}
\begin{Usage}
\begin{verbatim}
Machine()
.Machine
\end{verbatim}
\end{Usage}
\begin{Description}
\texttt{Machine()} returns information on numeric characteristics of the
machine \R\ is running on, such as the largest double or integer and the
machine's precision.

\texttt{.Machine} is a variable holding this information.

The algorithm is based on Cody's subroutine MACHAR (see the reference
below).\end{Description}
\begin{Value}
\texttt{Machine()} returns a list with components (for simplicity, the
prefix ``double'' is omitted in the explanations)
\begin{ldescription}
\item[\texttt{double.eps}] the smallest positive floating-point number
\texttt{x} such that \texttt{1 + x != 1}.  It equals
\texttt{base$\,\hat{\,}$ulp.digits} if either \texttt{base} is 2 or \texttt{rounding}
is 0;  otherwise, it is \texttt{(base$\,\hat{\,}$ulp.digits) / 2}.
\item[\texttt{double.neg.eps}] a small positive floating-point number \texttt{x}
such that \texttt{1 - x != 1}.  It equals \texttt{base$\,\hat{\,}$neg.ulp.digits}
if \texttt{base} is 2 or \texttt{round} is 0;  otherwise, it is
\texttt{(base$\,\hat{\,}$neg.ulp.digits) / 2}.
As \texttt{neg.ulp.digits} is bounded below by \texttt{-(digits + 3)},
\texttt{neg.eps} may not be the smallest number that can alter 1 by
subtraction.
\item[\texttt{double.xmin}] the smallest non-vanishing normalized
floating-point power of the radix, i.e., \texttt{base$\,\hat{\,}$min.exp}.
\item[\texttt{double.xmax}] the largest finite floating-point number.
Typically, it is equal to \texttt{(1 - neg.eps) * base$\,\hat{\,}$max.exp}, but
on some machines it is only the second, or perhaps third, largest
number, being too small by 1 or 2 units in the last digit of the
significand.
\item[\texttt{double.base}] the radix for the floating-point representation
\item[\texttt{double.digits}] the number of base digits in the floating-point
significand
\item[\texttt{double.rounding}] the rounding action. \\{}
0 if floating-point addition chops; \\{}
1 if floating-point addition rounds, but not in the IEEE style; \\{}
2 if floating-point addition rounds in the IEEE style; \\{}
3 if floating-point addition chops, and there is partial underflow; \\{}
4 if floating-point addition rounds, but not in the IEEE style, and
there is partial underflow; \\{}
5 if floating-point addition rounds in the IEEE style, and there is
partial underflow
\item[\texttt{double.guard}] the number of guard digits for multiplication
with truncating arithmetic.  It is 1 if floating-point arithmetic
truncates and more than \texttt{digits} base \texttt{base} digits
participate in the post-normalization shift of the floating-point
significand in multiplication, and 0 otherwise.
\item[\texttt{double.ulp.digits}] the largest negative integer \texttt{i} such
that \texttt{1 + base$\,\hat{\,}$i != 1}, except that it is bounded below by
\texttt{-(digits + 3)}.
\item[\texttt{double.neg.ulp.digits}] the largest negative integer \texttt{i}
such that \texttt{1 - base$\,\hat{\,}$i != 1}, except that it is bounded below by
\texttt{-(digits + 3)}.
\item[\texttt{double.exponent}] the number of bits (decimal places if \texttt{base} is 10) reserved
for the representation of the exponent (including the bias or sign)
of a floating-point number
\item[\texttt{double.min.exp}] the largest in magnitude negative integer \texttt{i} such that
\texttt{base $\,\hat{\,}$ i} is positive and normalized.
\item[\texttt{double.max.exp}] the smallest positive power of \texttt{base} that overflows.
\item[\texttt{integer.max}] the largest integer which can be represented.
\end{ldescription}
\end{Value}
\begin{References}
W. J. Cody (1988),
\emph{MACHAR: A Subroutine to Dynamically Determine Machine
Parameters}.
Transactions on Mathematical Software, \bold{14}, 4, 303-311.\end{References}
\begin{SeeAlso}
\texttt{\Link{machine}} to determine the computer type, \R\ is running on.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
str(Machine())
1 +     .Machine$double.eps != 1
1 + .5* .Machine$double.eps == 1
\end{ExampleCode}
\end{Examples}

