[Rd] round behaves differently from ceiling, floor for matrices with 0 rows (PR#4710)

w.huber at dkfz-heidelberg.de w.huber at dkfz-heidelberg.de
Tue Oct 21 20:48:28 MEST 2003


Full_Name: Wolfgang Huber
Version: 1.8.0
OS: Linux
Submission from: (NULL) (193.174.58.146)


base::round converts a matrix with 0 rows into numeric(0),
while floor and ceiling return a matrix of the same size:

> round(matrix(0, nrow=0, ncol=3))
numeric(0)

> ceiling(matrix(0, nrow=0, ncol=3))
     [,1] [,2] [,3]
> floor(matrix(0, nrow=0, ncol=3))
     [,1] [,2] [,3]
> round(matrix(0, nrow=1, ncol=3))
     [,1] [,2] [,3]
[1,]    0    0    0

> version
         _
platform i686-pc-linux-gnu
arch     i686
os       linux-gnu
system   i686, linux-gnu
status
major    1
minor    8.0
year     2003
month    10
day      08
language R



More information about the R-devel mailing list