R/log2int.R

Defines functions log2int

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 June 11, 2022, 3 p.m.