Skip to content
Prev 30792 / 398513 Next

bit set or bit test

Hi Mike,

I'm not sure I understand your message, but see if this example is useful.

ntharray <- rbind(c(1,0,0,1,0),c(0,0,1,0,1))
ntharray%*%2^(0:(ncol(ntharray)-1))
#     [,1]
#[1,]    9
#[2,]   20

See also ?binary in package "wle".
library(wle)
binary(9,dim=5)
#$binary
#[1] 1 0 0 1 0
#
#$dicotomy
#[1]  TRUE FALSE FALSE  TRUE FALSE

HTH,
Jerome
On April 16, 2003 11:45 pm, Mike Sumner wrote: