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 Sept. 30, 2023, 5:06 p.m.