Displaying 1 result from an estimated 1 matches for "binary2decimal".
2002 Oct 14
4
log10(), floor() combo issue?
Hi all,
in my search for a nice binary2decimal method, I received this nice
code (thanx to Uwe Ligges):
bindec <- function(b)
sum(as.integer(unlist(strsplit(b, ""))) * 2^(floor(log10(b)):0))
It fails, however, with:
> bindec(1000)
[1] 4
Warning message:
longer object length
is not a multiple of shorter object leng...