Skip to content
Prev 67517 / 398506 Next

Why is 1 a double?

I'm not sure that this answers your questions but maybe they partly help.

p. 7 in An introduction to R notes

"For most purposes the user will not be concerned if the "numbers" in a numeric vector
are integers, reals or even complex. Internally calculations are done as double precision real
numbers, or double precision complex numbers if the input data are complex."

p. 13 of the R Language Definition notes

"Numeric calculations whose result is undefined, such as '0/0' produce (on most, if not all,
platforms) the value NaN. This exists only in the double type."

p. 164 of the Reference manual notes


"Integer vectors exist so that data can be passed to C or Fortran code which expects them, and so that
small integer data can be represented exactly and compactly.
Note that on almost all implementations of R the range of representable integers is restricted to
about ?2 ? 109: doubles can hold much larger integers exactly."

Tom