File: mask.s

package info (click to toggle)
hmisc 5.2-4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,044 kB
  • sloc: asm: 28,905; f90: 590; ansic: 415; xml: 160; fortran: 75; makefile: 2
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