Calculating primes using only odd divisors is slower
问题 I've written a small C program to calculate primes and now try to optimize the code as far as I can. In the first revision of the program I was checking if a number was even (modulo 2) and if it was I would continue to the next number. In my second revision I tried only checking odd numbers to be possible primes by incrementing the number I would be checking by 2 (so I would start from 3, then check 5, then 7, then 9, then 11 etc etc). I thought this would be way faster as I had cut an extra