#How to make this code faster?

2 messages · Page 1 of 1 (latest)

uncut mesa
#

Starting with 2 instead of starting by the actual number worked out really well, but when a number is a prime one it takes some minutes, do you know how make this whole thing faster? is just a simple program that by prime factorization it semplifies a square root

cunning elm
#

I'm pretty sure you can change the x/2 to sqrt(x) in the loop of isPrimeNumber