pial
v1.0.1
Published
Check if a number is a prime number.
Downloads
7
Maintainers
Readme
Pial
Check if a number is a prime number. Extremely fast; complexity: O(sqrt(n/2))
.
Install
npm install pial
Usage
const pial = require("pial");
pial(3);
//=> true
pial(8);
//=> false
Tips
Use mem
to cache the return values.
const mem = require("mem");
const pial = mem(require("pial"));
pial(10);
//=> false
pial(10); // Cached value
//=> false
API
pial(number)
number
Type: number
The number to check.