Making it clear which package log2() is coming from (#3)

This commit is contained in:
Waldir Leoncio 2022-12-23 14:14:27 +01:00
parent 12a33a3933
commit 3a479d1232

View file

@ -10,7 +10,7 @@ dec2bitv <- function(d, n) {
d <- d[] d <- d[]
f <- e <- NA f <- e <- NA
c(f, e) <- log2(max(d)) # How many digits do we need to represent the numbers? c(f, e) <- matlab2r::log2(max(d)) # How many digits do we need to represent the numbers?
bits <- floor(d * 2 ^ (seq(1 - max(n, e), 0))) %% 2 bits <- floor(d * 2 ^ (seq(1 - max(n, e), 0))) %% 2
return(bits) return(bits)
} }