File: mask.s

package info (click to toggle)
hmisc 3.14-5-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,792 kB
  • ctags: 701
  • sloc: asm: 23,440; fortran: 600; ansic: 375; xml: 160; makefile: 1
file content (13 lines) | stat: -rw-r--r-- 289 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
mask<- function(a)
{
  ##determine which bits are on in a vector of status bytes
  if(a>=.Machine$integer.max)
    stop("Value > integer.max")
  
  a <- as.integer(a) 
  as.logical((rep(a, 8)%/%rep(2^(0:7), rep(length(a),8)))%%2)
}

##  Rick Becker
##  Improved by Peter Melewski 14Apr02