I'm creating a program which checks if the number numb
is prime and if it's not then it factorizes the number into prime numbers and prints out the factors but the problem fails with big numbers.
for n in primes:
if numb % n == 0:
a = 0
while numb % n == 0:
a += 1
factors[n] = a
prime = False
numb = numb / n
When numb
is big (18 digits long) the program fails at the numb = numb / n
and it doesn't divide correctly (for example 231351651321912318 / 2 = 1.1567582566095616e+17)
Numbers always should divide without any decimal places so can I make that the result is more accurate?