mixed-radix

How to Convert from a Residual Number System to a Mixed Radix System?

冷暖自知 提交于 2019-12-21 20:48:28
问题 I understand the concept of a Residual Number System and the concept of a Mixed Radix system, but I'm having difficulty getting any of the conversion methods I find to work in a simple case study. I started at Knuth's Art of Computer Programming but that had a bit too much on the theory of the conversion, and once Euler was mentioned I was lost. Wikipedia has a nice section on the subject, which I tried here and here but both times I couldn't get back to the number where I started. I found a

How to Convert from a Residual Number System to a Mixed Radix System?

江枫思渺然 提交于 2019-12-04 11:50:34
I understand the concept of a Residual Number System and the concept of a Mixed Radix system , but I'm having difficulty getting any of the conversion methods I find to work in a simple case study. I started at Knuth's Art of Computer Programming but that had a bit too much on the theory of the conversion, and once Euler was mentioned I was lost. Wikipedia has a nice section on the subject, which I tried here and here but both times I couldn't get back to the number where I started. I found a good article here (PDF) , which I condensed the relevant sections here , but I don't understand the

Converting a decimal to a mixed-radix (base) number

百般思念 提交于 2019-11-29 04:35:05
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. Artelius 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) Number -> set: factors = [52,7,24,60,60,1000] value = 662321 for i in n-1..0 res[i] = value mod factors[i] value = value div factors[i] And the reverse: If you have the number like

Converting a decimal to a mixed-radix (base) number

五迷三道 提交于 2019-11-27 18:40:45
问题 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. 回答1: 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: Number -> set: factors = [52,7,24,60,60,1000] value = 662321 for i in n-1..0