From p.dalgaard@biostat.ku.dk  Tue Feb 11 19:43:03 2003
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: Tue Feb 11 19:43:03 2003
Subject: [Rd] cbind rises floating point exception (PR#2541)
In-Reply-To: <200302111825.h1BIPc35012963@pubhealth.ku.dk>
References: <200302111825.h1BIPc35012963@pubhealth.ku.dk>
Message-ID: <x2d6ly64l0.fsf@biostat.ku.dk>

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



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