powered by
In case of powers of 2, function gives exact result.
sizeinbase(a, b=10)
"bigz"
a
a[i]
sizeinbase(342434, 10)# 6 obviously Iv <- as.bigz(2:7)^500 sizeinbase(Iv) stopifnot(sizeinbase(Iv) == nchar(as.character(Iv)), sizeinbase(Iv, b=16) == nchar(as.character(Iv, b=16)))
Run the code above in your browser using DataLab