| Line 109... |
Line 109... |
| 109 |
accuracy if \code{x} is much larger than \code{y}, and a warning is
|
109 |
accuracy if \code{x} is much larger than \code{y}, and a warning is
|
| 110 |
given if this is detected.
|
110 |
given if this is detected.
|
| 111 |
|
111 |
|
| 112 |
\code{\%\%} and \code{x \%/\% y} can be used for non-integer \code{y},
|
112 |
\code{\%\%} and \code{x \%/\% y} can be used for non-integer \code{y},
|
| 113 |
e.g.\sspace{}\code{1 \%/\% 0.2}, but the results are subject to representation
|
113 |
e.g.\sspace{}\code{1 \%/\% 0.2}, but the results are subject to representation
|
| 114 |
error and so may be platform-dependent. Because the IEC 60059
|
114 |
error and so may be platform-dependent. Because the IEC 60559
|
| 115 |
representation of \code{0.2} is a binary fraction slightly larger than
|
115 |
representation of \code{0.2} is a binary fraction slightly larger than
|
| 116 |
\code{0.2}, the answer to \code{1 \%/\% 0.2} should be \code{4} but
|
116 |
\code{0.2}, the answer to \code{1 \%/\% 0.2} should be \code{4} but
|
| 117 |
most platforms give \code{5}.
|
117 |
most platforms give \code{5}.
|
| 118 |
|
118 |
|
| 119 |
Users are sometimes surprised by the value returned, for example why
|
119 |
Users are sometimes surprised by the value returned, for example why
|
| Line 142... |
Line 142... |
| 142 |
optional. In particular, the support for \emph{denormal} aka
|
142 |
optional. In particular, the support for \emph{denormal} aka
|
| 143 |
\emph{subnormal} numbers
|
143 |
\emph{subnormal} numbers
|
| 144 |
(those outside the range given by \code{\link{.Machine}}) may differ
|
144 |
(those outside the range given by \code{\link{.Machine}}) may differ
|
| 145 |
between platforms and even between calculations on a single platform.
|
145 |
between platforms and even between calculations on a single platform.
|
| 146 |
|
146 |
|
| 147 |
Another potential issue is signed zeroes: on IEC 60659 platforms there
|
147 |
Another potential issue is signed zeroes: on IEC 60559 platforms there
|
| 148 |
are two zeroes with internal representations differing by sign. Where
|
148 |
are two zeroes with internal representations differing by sign. Where
|
| 149 |
possible \R treats them as the same, but for example direct output
|
149 |
possible \R treats them as the same, but for example direct output
|
| 150 |
from C code often does not do so and may output \samp{-0.0} (and on
|
150 |
from C code often does not do so and may output \samp{-0.0} (and on
|
| 151 |
Windows whether it does so or not depends on the version of Windows).
|
151 |
Windows whether it does so or not depends on the version of Windows).
|
| 152 |
One place in \R where the difference might be seen is in division by
|
152 |
One place in \R where the difference might be seen is in division by
|
| Line 181... |
Line 181... |
| 181 |
\cr
|
181 |
\cr
|
| 182 |
Postscript version available at
|
182 |
Postscript version available at
|
| 183 |
\url{http://www.validlab.com/goldberg/paper.ps}.
|
183 |
\url{http://www.validlab.com/goldberg/paper.ps}.
|
| 184 |
Extended PDF version at
|
184 |
Extended PDF version at
|
| 185 |
\url{http://www.validlab.com/goldberg/paper.pdf}.
|
185 |
\url{http://www.validlab.com/goldberg/paper.pdf}.
|
| - |
|
186 |
|
| - |
|
187 |
For the IEC 60559 (aka IEEE 754) standard:
|
| - |
|
188 |
\url{https://www.iso.org/standard/57469.html} and
|
| - |
|
189 |
\url{https://en.wikipedia.org/wiki/IEEE_754}.
|
| 186 |
}
|
190 |
}
|
| 187 |
\seealso{
|
191 |
\seealso{
|
| 188 |
\code{\link{sqrt}} for miscellaneous and \code{\link{Special}} for special
|
192 |
\code{\link{sqrt}} for miscellaneous and \code{\link{Special}} for special
|
| 189 |
mathematical functions.
|
193 |
mathematical functions.
|
| 190 |
|
194 |
|