-
Notifications
You must be signed in to change notification settings - Fork 0
isPrime
Subhajit Sahu edited this page Aug 9, 2022
·
3 revisions
Check if number is prime.
Similar: properDivisors, primeFactors, primeExponentials, isPrime.
function isPrime(x)
// x: a number
const xnumber = require('extra-number');
xnumber.isPrime(7);
// → true
xnumber.isPrime(53);
// → true
xnumber.isPrime(4);
// → false
xnumber.isPrime(1);
// → false
xnumber.isPrime(0);
// → false