Peter Dalgaard BSA writes:
Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:
On the system I have access to, I can compile only with
-D_XOPEN_SOURCE_EXTENDED=2 (VERY noisy)
or
-D_ALL_SOURCE
In either case, we get the above.
I will hence use ALL_SOURCE for the time being.
Note that
[1] TRUE
so what is really going on here???
Can you run this under gdb? If so, could you set a breakpoint in
EncodeReal and step through it?
R -d gdb
(gdb) run
^C
(gdb) break EncodeReal
(gdb) continue
I bet it never enters the "if (!R_FINITE(x))" branch as it should.
This could happen if HAVE_FINITE and IEEE_754 are both undefined in
Arith.h, or if finite(x) doesn't work in the IEEE way.
From what Martin has been telling us, AIX is using IEEE format numbers
and arithmetic anyhow, so it should be fairly easy to fudge a better
R_FINITE (and ISNAN too). I think we went through some of that last
time we had R_FINITE/ISNAN and friends on the board, didn't we?
Something pretty close to the following should work:
#define R_FINITE(x) ({double y = x; \
*((int *) &y) & 0x7ff00000 != 0x7ff00000})
#define ISNAN(x) ({double y = x; \
*((int *) &y) & 0x7ff00000 == 0x7ff00000 && \
(*((int *) &y) & 0x7fffffff != 0x7ff00000 || *((int *) &y + 1) != 0)}
Of course, that kind of code is pretty architecture dependent, etc...
Perhaps one should first check what the status of IEEE macros in AIX
really is.