Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Project: The Prime Number Calculator

Discussion in 'Website Design Critique:' started by Xenonsoft, Jul 8, 2009.

  1. Xenonsoft

    Xenonsoft Active Member

    I've been learning a bit of JavaScript the past week and set myself a challenge of making a Prime Number Calculator that would be accurate to any number put in by the user.

    Anyway, I've finished it and thought I'd let you lot know to see what you think, feel free to check it out or drop a comment on the site :)

    DefaultYes - Prime Number Calc Complete

    Cheers :up:

    Note: It may well serve no purpose, but I enjoyed creating it and learnt a lot :D
    Note2: Please let me know if there's any errors, I've done some checking over it so it should be fine though, tested up to the 10,000th prime.
     
  2. Mohammad

    Mohammad Guest

    nice job fred keep it up!
     
  3. Xenonsoft

    Xenonsoft Active Member

    Cheers Mo, surprised I managed to do it but I've learnt a lot this past week :D
     
  4. Kevin

    Kevin Senior Member

    Crashed my browser when attempting 100,000,000 :lol:
    Didn't read the note at the bottom, wasn't expecting that there would be so many prime numbers :p
     
  5. Xenonsoft

    Xenonsoft Active Member

    Haha Gary, silly boy :D
     
  6. mrp2049

    mrp2049 Senior Member

    fred, this is cool, but 1 is a prime number too!
     
  7. Xenonsoft

    Xenonsoft Active Member

    It is at the mo, gotta do some updates.

    Fixed that bug, gotta fix the one that says pie is a prime :D

    Any text string skips through currently, need to add a fix for that.

    EDIT: My bad, thought you said 1 wasn't. That was coming up as a prime before, must have fixed that earlier. I lose track :D
     
  8. Kevin

    Kevin Senior Member

    No, it's not actually :)
    Although it qualifies the common rule (dividable by 1 and itself only) it interferes with the actual fundamental rule (where both divisors have to be different) and other rules that are based on prime numbers.
     
  9. Renniks

    Renniks Senior Member

    Prime Number -- from Wolfram MathWorld

    Third paragraph of that explains why, decided not to paraphrase and just link it...

     
  10. Kevin

    Kevin Senior Member

    I noticed that any non-numerical entry is a prime number :p

    [​IMG]
     
  11. Renniks

    Renniks Senior Member

    Gary is a prime number though :D
     
  12. Xenonsoft

    Xenonsoft Active Member

    :lol:

    Regarding the 1 malarky, I thought he said it was showing as a prime rather than not a prime, no need to fix that then.

    Had it showing as a prime before so had to add in some other clauses.
     
  13. mrp2049

    mrp2049 Senior Member

    I am even more confused! This is a day to be confused!
     
  14. glenwheeler

    glenwheeler Senior Member

    haha!! did exactly the same for me! I had to close and re open my browser
     

Share This Page