--- Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
To expand on Dirk's answer, R relies on fairly close compliance to
IEC60559 (aka IEEE754) arithmetic in which 0/0 = NaN. As R is
C/Fortran
program, this is a function of your C/Fortran compilers (it is most
likely
an FPU setting controlled by the compiler than libc). Problems in
this
area are documented in the R-admin manual.
We don't know the CPU here, so ix86 is a plausible guess. That has
a FPU
control word that determines if 0/0 is NaN or an exception. Prior
to
glibc 2.1 it could be set by __setfpucw and R sets it if
NEED___SETFPUCW
is defined (only in older Linuxen).
Other people using Gentoo are not reporting problems, so this has
to be a
very specific problem, one which is best addressed to a Gentoo
list. Try
a very simple C program such as
#include <stdio.h>
int main()
{
double x = 0.0;
printf("x/x = %f\n", x/x);
}
R is doing nothing different on my Linux box (except it arranges to
print
NaN not nan regardless of platform).
On Thu, 18 Aug 2005, Dirk Eddelbuettel wrote:
On 18 August 2005 at 16:01, Xing Qiu wrote:
| Hi,
|
| I noticed that when I was conducting some calculation
| finding correlation coeficients, R stopped abnormally. So I did
| research, and find out that 0/0 was the culprit. For sure 0/0
| a valid expression, but R should give a warning, an error msg
| instead of segmentation fault.
|
| I am using R 2.1.0 under Gentoo Linux. My GCC version is
edd at basebud:~> R
R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for a HTML browser interface to help.
Type 'q()' to quit R.
No problem on Debian 'testing' with R 2.1.1. You may want to try
libc.
Dirk
--
Statistics: The (futile) attempt to offer certainty about
-- Roger Koenker, 'Dictionary of Received Ideas of