powered by
Takes an integer and converts it into an arbitrary base e.g. binary or octal. Note that the first digit in the output is the least significant.
number2digits(n, base = 2)
a vector of length ceiling(log(n+1,base)) respresenting each digit for that numeral system
ceiling(log(n+1,base))
the integer to be converted
the base for the numeral system (e.g. 2 for binary or 8 for octal)
https://en.wikipedia.org/wiki/Radix
number2digits(100) number2digits(100,8)
Run the code above in your browser using DataLab