.Machine {base} | R Documentation |
.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.
.Machine
The algorithm is based on Cody's (1988) subroutine MACHAR. As all current implementations of R use 32-bit integers and use IEC 60559 floating-point (double precision) arithmetic, all but three of the last four values are the same for almost all R builds.
Note that on most platforms smaller positive values than
.Machine$double.xmin
can occur. On a typical R platform the
smallest positive double is about 5e-324
.
A list with components
double.eps |
the smallest positive floating-point number
|
double.neg.eps |
a small positive floating-point number |
double.xmin |
the smallest non-zero normalized
floating-point number, a power of the radix, i.e.,
|
double.xmax |
the largest normalized floating-point number.
Typically, it is equal to |
double.base |
the radix for the floating-point representation:
normally |
double.digits |
the number of base digits in the floating-point
significand: normally |
double.rounding |
the rounding action, one of |
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. Always 2^31 - 1 = 2147483647. |
sizeof.long |
the number of bytes in a C |
sizeof.longlong |
the number of bytes in a C |
sizeof.longdouble |
the number of bytes in a C |
sizeof.pointer |
the number of bytes in a C |
sizeof.longdouble
only tells you the amount of storage
allocated for a long double (which are normally used internally by R for
accumulators in e.g. sum
, and can be read by
readBin
). Often what is stored is the 80-bit extended
double type of IEC 60559, padded to the double alignment used on the
platform — this seems to be the case for the common R platforms
using ix86 and x86_64 chips.
Uses a C translation of Fortran code in the reference, modified by the R Core Team to defeat over-optimization in recent compilers.
Cody, W. J. (1988) MACHAR: A subroutine to dynamically determine machine parameters. Transactions on Mathematical Software, 14, 4, 303–311.
.Platform
for details of the platform.
.Machine ## or for a neat printout noquote(unlist(format(.Machine)))