Machine {base} | R Documentation |
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.
.Machine
is a variable holding this information.
Machine()
.Machine
The algorithm is based on Cody's (1988) subroutine MACHAR.
Machine()
returns a list with components (for simplicity, the
prefix “double” is omitted in the explanations)
double.eps |
the smallest positive floating-point number
|
double.neg.eps |
a small positive floating-point number |
double.xmin |
the smallest non-vanishing normalized
floating-point power of the radix, i.e., |
double.xmax |
the largest finite floating-point number.
Typically, it is equal to |
double.base |
the radix for the floating-point representation |
double.digits |
the number of base digits in the floating-point significand |
double.rounding |
the rounding action. |
double.guard |
the number of guard digits for multiplication
with truncating arithmetic. It is 1 if floating-point arithmetic
truncates and more than |
double.ulp.digits |
the largest negative integer |
double.neg.ulp.digits |
the largest negative integer |
double.exponent |
the number of bits (decimal places if |
double.min.exp |
the largest in magnitude negative integer |
double.max.exp |
the smallest positive power of |
integer.max |
the largest integer which can be represented. |
sizeof.long |
the number of bytes in a C |
sizeof.longlong |
the number of bytes in a C |
Cody, W. J. (1988) MACHAR: A subroutine to dynamically determine machine parameters. Transactions on Mathematical Software, 14, 4, 303–311.
machine
to determine the computer type which R is running on.
str(Machine())
(Meps <- .Machine $ double.eps)
## All the following relations must hold :
stopifnot(
1 + Meps != 1,
1 + .5* Meps == 1,
log2(.Machine$double.xmax) == .Machine$double.max.exp,
log2(.Machine$double.xmin) == .Machine$double.min.exp
)