Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
isprime function
#6
Your function assumes that all composite numbers above 10 are divisible by a number smaller than 10; not true.

Here's an article explaining some of the intricacies that go into finding prime numbers Smile.

Keep in mind that the first method mentioned could be optimized more by only checking numbers smaller than sqrt(num) instead of num / 2.
Reply


Messages In This Thread
isprime function - by nevets04 - 02-23-2010, 01:54 PM
RE: isprime function - by uber1337 - 02-23-2010, 06:46 PM
RE: isprime function - by Fallen - 04-05-2010, 06:15 PM
RE: isprime function - by uber1337 - 04-06-2010, 12:03 PM
RE: isprime function - by symetrik - 04-18-2010, 11:08 AM
RE: isprime function - by wat - 05-05-2010, 05:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Basic filter function uber1337 1 826 08-13-2010, 10:59 AM
Last Post: xerotic

Forum Jump:


Users browsing this thread: 1 Guest(s)