| Line 1... |
Line 1... |
| 1 |
% File src/library/base/man/double.Rd
|
1 |
% File src/library/base/man/double.Rd
|
| 2 |
% Part of the R package, http://www.R-project.org
|
2 |
% Part of the R package, http://www.R-project.org
|
| 3 |
% Copyright 1995-2011 R Core Team
|
3 |
% Copyright 1995-2013 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{double}
|
6 |
\name{double}
|
| 7 |
\title{Double-Precision Vectors}
|
7 |
\title{Double-Precision Vectors}
|
| 8 |
\alias{double}
|
8 |
\alias{double}
|
| Line 30... |
Line 30... |
| 30 |
\item{\dots}{further arguments passed to or from other methods.}
|
30 |
\item{\dots}{further arguments passed to or from other methods.}
|
| 31 |
}
|
31 |
}
|
| 32 |
\details{
|
32 |
\details{
|
| 33 |
\code{double} creates a double-precision vector of the specified
|
33 |
\code{double} creates a double-precision vector of the specified
|
| 34 |
length. The elements of the vector are all equal to \code{0}.
|
34 |
length. The elements of the vector are all equal to \code{0}.
|
| 35 |
It is identical to \code{\link{numeric}} (and \code{real}).
|
35 |
It is identical to \code{\link{numeric}}.
|
| 36 |
|
36 |
|
| 37 |
\code{as.double} is a generic function. It is identical to
|
37 |
\code{as.double} is a generic function. It is identical to
|
| 38 |
\code{as.numeric} (and \code{as.real}). Methods should return an
|
38 |
\code{as.numeric}. Methods should return an object of base type
|
| 39 |
object of base type \code{"double"}.
|
39 |
\code{"double"}.
|
| 40 |
|
40 |
|
| 41 |
\code{is.double} is a test of double \link{type}.
|
41 |
\code{is.double} is a test of double \link{type}.
|
| 42 |
|
42 |
|
| 43 |
\emph{\R has no single precision data type. All real numbers are
|
43 |
\emph{\R has no single precision data type. All real numbers are
|
| 44 |
stored in double precision format}. The functions \code{as.single}
|
44 |
stored in double precision format}. The functions \code{as.single}
|
| Line 86... |
Line 86... |
| 86 |
|
86 |
|
| 87 |
In IEEE 754-2008/IEC60559:2011 this is called \sQuote{binary64} format.
|
87 |
In IEEE 754-2008/IEC60559:2011 this is called \sQuote{binary64} format.
|
| 88 |
}
|
88 |
}
|
| 89 |
%% keep next the same in double.Rd & numeric.Rd
|
89 |
%% keep next the same in double.Rd & numeric.Rd
|
| 90 |
\section{Note on names}{
|
90 |
\section{Note on names}{
|
| 91 |
It is a historical anomaly that \R has three names for its
|
91 |
It is a historical anomaly that \R has two names for its
|
| 92 |
floating-point vectors, \code{\link{double}}, \code{\link{numeric}}
|
92 |
floating-point vectors, \code{\link{double}} and \code{\link{numeric}}
|
| 93 |
and \code{\link{real}}.
|
93 |
(and formerly had \code{real}).
|
| 94 |
|
94 |
|
| 95 |
\code{double} is the name of the \link{type}.
|
95 |
\code{double} is the name of the \link{type}.
|
| 96 |
\code{numeric} is the name of the \link{mode} and also of the implicit
|
96 |
\code{numeric} is the name of the \link{mode} and also of the implicit
|
| 97 |
\link{class}. As an S4 formal class, use \code{"numeric"}.
|
97 |
\link{class}. As an S4 formal class, use \code{"numeric"}.
|
| 98 |
|
98 |
|
| 99 |
\code{real} is deprecated and should not be used in new code.
|
- |
|
| 100 |
|
- |
|
| 101 |
The potential confusion is that \R has used \emph{\link{mode}}
|
99 |
The potential confusion is that \R has used \emph{\link{mode}}
|
| 102 |
\code{"numeric"} to mean \sQuote{double or integer}, which conflicts
|
100 |
\code{"numeric"} to mean \sQuote{double or integer}, which conflicts
|
| 103 |
with the S4 usage. Thus \code{is.numeric} tests the mode, not the
|
101 |
with the S4 usage. Thus \code{is.numeric} tests the mode, not the
|
| 104 |
class, but \code{as.numeric} (which is identical to \code{as.double})
|
102 |
class, but \code{as.numeric} (which is identical to \code{as.double})
|
| 105 |
coerces to the class.
|
103 |
coerces to the class.
|