Skip to content

0.65/AIX

5 messages · Kurt Hornik, Peter Dalgaard

#
ToV> Sorry, but why do you need _XOPEN_SOURCE_EXTENDED to be defined?  And
ToV> why does -D_XOPEN_SOURCE_EXTENDED=2 work, albeit noisely?
Hmm ... Compilation-wise it seems that -D_ALL_SOURCE works o.k. for me.
Now, this gives
[1]INF
[1]NaNQ

which is only sort of o.k.???

For the time being, I'll commit this version ...

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:
No! ...which is patently WRONG. When this kind of printout, it shows
that the print routines in R are not able to recognize Inf and NaN
(using R_FINITE) which implies that they aren't properly recognized
anywhere else.
Not for long, I hope...
#
Hmm.

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]NaNQ
[1] TRUE

so what is really going on here???

-k


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:
Double "hmmmm"....

Can you run this under gdb? If so, could you set a breakpoint in
EncodeReal and step through it? 

That'll be (roughly)

R -d gdb
(gdb) run
^C
(gdb) break EncodeReal
(gdb) continue
(gdb) next
<etc.>

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.
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.
4 days later
#
Hmm ... I just realized that the AIX system I have access to has no gdb
(it does have dbx, but I never used it before ...).

Could anyone else try to do the above exercise?

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._