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