\HeaderA{.Machine}{Numerical Characteristics of the Machine}{.Machine}
\keyword{sysdata}{.Machine}
\keyword{programming}{.Machine}
\keyword{math}{.Machine}
\begin{Description}\relax
\code{.Machine} is a variable holding information on the numerical
characteristics of the machine \R{} is running on, such as the largest
double or integer and the machine's precision.
\end{Description}
\begin{Usage}
\begin{verbatim}
.Machine
\end{verbatim}
\end{Usage}
\begin{Details}\relax
The algorithm is based on Cody's (1988) subroutine MACHAR.  As almost
all current implementations of \R{} use 32-bit integers and IEC 60059
floating-point (double precision) arithmetic, most of these values are
the same for almost all \R{} builds.

Note that on most platforms smaller positive values than
\code{.Machine\$double.xmin} can occur.  On a typical \R{} platform the
smallest positive double is about \code{5e-324}.
\end{Details}
\begin{Value}
A list with components (for simplicity, the prefix \sQuote{double} is
omitted in the explanations)
\begin{ldescription}
\item[\code{double.eps}] the smallest positive floating-point number
\code{x} such that \code{1 + x != 1}.  It equals
\code{base\textasciicircum{}ulp.digits} if either \code{base} is 2 or \code{rounding}
is 0;  otherwise, it is \code{(base\textasciicircum{}ulp.digits) / 2}.  Normally
\code{2.220446e-16}.
\item[\code{double.neg.eps}] a small positive floating-point number \code{x}
such that \code{1 - x != 1}.  It equals \code{base\textasciicircum{}neg.ulp.digits}
if \code{base} is 2 or \code{round} is 0;  otherwise, it is
\code{(base\textasciicircum{}neg.ulp.digits) / 2}.  Normally \code{1.110223e-16}.
As \code{neg.ulp.digits} is bounded below by \code{-(digits + 3)},
\code{neg.eps} may not be the smallest number that can alter 1 by
subtraction.
\item[\code{double.xmin}] the smallest non-vanishing normalized
floating-point power of the radix, i.e., \code{base\textasciicircum{}min.exp}.
Normally \code{2.225074e-308}.
\item[\code{double.xmax}] the largest finite floating-point number.
Typically, it is equal to \code{(1 - neg.eps) * base\textasciicircum{}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.  Normally \code{1.797693e+308}.
\item[\code{double.base}] the radix for the floating-point representation:
normally \code{2}.
\item[\code{double.digits}] the number of base digits in the floating-point
significand: normally \code{53}.
\item[\code{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.  Normally \code{5}.
\item[\code{double.guard}] the number of guard digits for multiplication
with truncating arithmetic.  It is 1 if floating-point arithmetic
truncates and more than \code{digits} base \code{base} digits
participate in the post-normalization shift of the floating-point
significand in multiplication, and 0 otherwise.
\item[\code{double.ulp.digits}] the largest negative integer \code{i} such
that \code{1 + base\textasciicircum{}i != 1}, except that it is bounded below by
\code{-(digits + 3)}.  Normally \code{-52}.
\item[\code{double.neg.ulp.digits}] the largest negative integer \code{i}
such that \code{1 - base\textasciicircum{}i != 1}, except that it is bounded below by
\code{-(digits + 3)}. Normally \code{-53}.
\item[\code{double.exponent}] the number of bits (decimal places if \code{base} is 10) reserved
for the representation of the exponent (including the bias or sign)
of a floating-point number.  Normally \code{11}.
\item[\code{double.min.exp}] the largest in magnitude negative integer \code{i} such that
\code{base \textasciicircum{} i} is positive and normalized.  Normally \code{-1022}.
\item[\code{double.max.exp}] the smallest positive power of \code{base} that overflows.  Normally
\code{1024}.
\item[\code{integer.max}] the largest integer which can be represented.
Always \code{2147483647}.
\item[\code{sizeof.long}] the number of bytes in a C \code{long} type:
\code{4} or \code{8} (most 64-bit systems, but not Windows).
\item[\code{sizeof.longlong}] the number of bytes in a C \code{long long}
type.  Will be zero if there is no such type, otherwise usually
\code{8}.
\item[\code{sizeof.longdouble}] the number of bytes in a C \code{long double}
type.  Will be zero if there is no such type, otherwise possibly
\code{12} (Windows, 32-bit Linux/Solaris) or \code{16} (64-bit
Linux/Solaris, Intel Mac OS X).
\item[\code{sizeof.pointer}] the number of bytes in a C \code{SEXP}
type.  Will be \code{4} on 32-bit builds and \code{8} on 64-bit
builds of \R.
\end{ldescription}
\end{Value}
\begin{References}\relax
Cody, W. J. (1988)
MACHAR: A subroutine to dynamically determine machine parameters.
\emph{Transactions on Mathematical Software}, \bold{14}, 4, 303--311.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{.Platform}{.Platform}} for details of the platform.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
.Machine
## or for a neat printout
noquote(unlist(format(.Machine)))
\end{ExampleCode}
\end{Examples}

