I am surprised by some of the values returned when comparing Inf
and -Inf
with NA_real_
.
Specifically:
NA_real_ <= Inf
#[1] NA
-Inf <= NA_real_
#[1] NA
The first sentence of the documentation for NA
(help(NA)
) is
NA
is a logical constant of length 1 which contains a missing value indicator.
I suppose there must be some values which are not less than or equal to Inf
and some values that are not greater than or equal to -Inf
. What are those values? How do you represent them in R? Please provide a complete list.
I am somewhat familiar with NaN
's, but don't these arise out of computations that produce results that are simply out of the range of proper values that a double
can store? I don't know what Inf - Inf
is, exactly, but it can't be greater than Inf
. What's bigger than Inf
in the IEEE standard that double
is supposed to implement? Does that standard simply define that any operation involving NaN
returns NaN
? Then why doesn't R return NaN
? NA
is not an IEEE 754 value, is it? Maybe I am misreading the documentation?