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)
1.4m articles
1.4m replys
5 comments
57.0k users