Skip to content

Instantly share code, notes, and snippets.

@lorenzoongithub
Created July 5, 2015 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzoongithub/ad635d1a17601e2e7c38 to your computer and use it in GitHub Desktop.
Save lorenzoongithub/ad635d1a17601e2e7c38 to your computer and use it in GitHub Desktop.
//
// isPrime(n) --> returns boolean
// returns true if the number is prime.
//
load('http://www.yolpo.com/prime.0.1.js');
if (isPrime(2) != true) throw '';
if (isPrime(4) == true) throw '';
if (isPrime(169) == true) throw '';
if (isPrime(107777) != true) throw '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment