Results 1 to 2 of 2

Thread: prime tests in java

  1. #1
    Join Date
    Dec 2004
    Location
    Colorado USA
    Posts
    11

    Default prime tests in java

    i need a fast method to find if a number is prime. the number is alway more than 5 and less than 100000000
    i have tried the sieve of Eratosthenes, but it sometimes runs into a memory stack overflow error.

  2. #2
    Join Date
    Mar 2005
    Location
    Brighton, UK
    Posts
    19

    Default Some ideas for prime tests in java

    Maybe either of these may do....not too sure how fast they are but they might be useful: -

    http://www.brighton.ac.uk/java/exercise/s_ch4_4.html

    http://www.computing.net/programming...rum/11287.html

    Not surprised about the stack overflow errors though. :)

    nexus.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •