Displaying 3 results from an estimated 3 matches for "ieee_double".
2014 Feb 10
1
Question re: NA, NaNs in R
Hi R-devel,
I have a question about the differentiation between NA and NaN values
as implemented in R. In arithmetic.c, we have
int R_IsNA(double x)
{
if (isnan(x)) {
ieee_double y;
y.value = x;
return (y.word[lw] == 1954);
}
return 0;
}
ieee_double is just used for type punning so we can check the final
bits and see if they're equal to 1954; if they are, x is NA, if
they're not, x is NaN (as defined for R_IsNaN).
My question is -- I can see a substantial...
2003 Apr 06
1
RH 9 and R 1.7.0 Beta - Errors Resolved
...ut errors.
Bottom line, it appears that R_NaReal was not being set properly. It
would take the value of nan(0x8000000000000) instead of
nan(0x80000000007a2). This is set in R_NaReal = R_ValueOfNA().
The present version in arithmetic.c is:
117 static double R_ValueOfNA(void)
118 {
119 ieee_double x;
120 x.word[hw] = 0x7ff00000;
121 x.word[lw] = 1954;
122 return x.value;
123 }
The change is in line 119 to:
volatile ieee_double x;
This has resolved the problem and now results in no errors being
reported during make check with the default ./configure.
Thus, now using:...
2019 Sep 29
2
speed up R_IsNA, R_IsNaN for vector input
Dear R developers,
I spotted that R_isNA and R_IsNaN could be improved when applied on a
vector where we could take out small part of their logic, run it once,
and then reuse inside the loop.
I setup tiny plain-C experiment. Taking R_IsNA, R_IsNaN from R's
arithmetic.c, and building R_vIsNA and R_vIsNaN accordingly.
For double input of size 1e9 (having some NA and NaN) I observed
following