How do you convert a decimal number to mixed radix notation?
I guess that given an input of an array of each of the bases, and the decimal number, it should output an array of the values of each column.
Pseudocode:
bases = [24, 60, 60] input = 86462 #One day, 1 minute, 2 seconds output = [] for base in reverse(bases) output.prepend(input mod base) input = input div base #div is integer division (round down)
2.1m questions
2.1m answers
60 comments
57.0k users