R/convert_dec2bin.R

Defines functions convert_dec2bin

Documented in convert_dec2bin

#' @export
convert_dec2bin <- function(x,len=32){
	b <- as.integer(rev(intToBits(x)))
	if(len < 32)
		b <- b[ (32-len+1):32 ]
	if(len > 32)
		b <- c( rep(0,len-32) , b)
	b
}

Try the QuantumOps package in your browser

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

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.