R/encode.R

Defines functions encode

Documented in encode

# Convert from real number to binary number
encode = function(real, lb, ub, m){
  num = (real-lb)*(2^m-1)/(ub-lb)
  bin = int2bin(num, m)
  return(bin)
}

Try the adana package in your browser

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

adana documentation built on March 18, 2022, 6:03 p.m.