Mostly. It gives the number instead of 1 if the number is prime. That really isn't a big deal.
So you have a couple of the fastest implementations. The Inline::C is only barely winning though that might be static. The interesting thing is that many solutions are faster than using Math::Pari to get a list of factors and doing a binary search.$ time ./rjnew.pl real 1m8.446s user 1m1.338s sys 0m0.440s
Cheers - L~R
In reply to Re^5: OT: Finding Factor Closest To Square Root
by Limbic~Region
in thread OT: Finding Factor Closest To Square Root
by QM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |