R/log2int.R

log2int<-function(bin)
{
  n<-length(bin);
  int<-0
  for (k in 0:(n-1))
    int<-int+as.numeric(bin[n-k])*2^k
  int
}

Try the prefmod package in your browser

Any scripts or data that you put into this service are public.

prefmod documentation built on May 2, 2019, 4:59 p.m.