[Rd] cbind rises floating point exception (PR#2541)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
Tue Feb 11 19:43:03 2003


rdiaz@cnio.es writes:

> > x <- matrix(1:10, ncol = 2)
> > xc <- cor(x[, 2],  x[, 0])
> > cbind(xc, vector())

[SIGFPE]

Confirmed. Similar effect:

y <- matrix(0,1,0)
cbind(y,vector())

Actually not a floating point error but an arithmetic exception from
calculation of

i % k

with i = k = 0 at l.1123 in bind.c. Presumably the "if (length(u) >=
lenmin)" should also check that length(u) > 0.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907