摘要 |
PROBLEM TO BE SOLVED: To judge whether or not an arbitrary dividend is divisible by a divisor which is a prime number. SOLUTION: The apparatus is provided with a first register 11 into which a divisor X being a prime number is inputted, a second register 12 into which an arbitrary dividend Y is inputted, a processing part 13 to determine a multiplier value A so that the low order places of a multiplication value B obtained by multiplying the divisor X being a prime number by the multiplier value A coincide with the low order places of the arbitrary dividend Y, a multiplication part 14 to multiply the divisor X and the multiplier value A to calculate the multiplication value B, a subtraction part 15 to subtract a multiplication value B from a dividend Y to calculate a subtraction value C, a division part 17 to divide 0 being the low order place of the subtraction value C to calculate a division value D, a switching feed part 18 to switch the division value D to the dividend Y, and a deciding part 16 to decide whether or not the dividend Y is divisible by the divisor X. |