This commit is contained in:
11
node_modules/licia/isPrime.js
generated
vendored
Normal file
11
node_modules/licia/isPrime.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
exports = function(num) {
|
||||
var boundary = Math.floor(Math.sqrt(num));
|
||||
for (var i = 2; i <= boundary; i++) {
|
||||
if (num % i === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return num >= 2;
|
||||
};
|
||||
|
||||
module.exports = exports;
|
||||
Reference in New Issue
Block a user