You don't need to use sqrt() to do the optimization.
Code:result = possible_prime / possible_factor;
if(result < possible_factor)
{
/* Obviously, we've crossed the square root at this point. */
}
Printable View
HEY you've been looking at my notes :D
Actually I just do that step to determine if I need to Root++
different implementation, btu the same core method. The reason I increase root by 2 is we will only be checking odd number factors anyway.Code:if(Prime / Root > Root) Root+=2;
oh gawd, yeah i totally missed that one, it shodul be
thanks for catching that nub mistake vart :DCode:if(!(Target & 1)) return FALSE;
BTW, for anyone that tried to D/L the primes in the last few days and got a service message, the site is back up and running. Sorry I forgot to pay the bill :rolleyes: