is-prime-100
v1.0.1
Published
Check primality of a number in O(1). Works for every single positive integer, except ones bigger than 500_000
Downloads
11
Readme
is-prime-100-js: JS Port Of A Revolutionary O(1) Algorithm for Prime Detection
Read more in-depth information in original Python repository
API
import isPrime from "is-prime-100";
console.log(isPrime(1)); // false
console.log(isPrime(2n)); // true, and also works with BigInt's!
// ...
console.log(isPrime(121)); // false
console.log(isPrime(503)); // true
Sadly, current implementation can't handle numbers bigger than 500_000. Our team of scientists is working on that.