isPrime
Checks if the provided integer is a prime number.
- Check numbers from
2to the square root of the given number. - Return
falseif any of them divides the given number, else returntrue, unless the number is less than2.
Checks if the provided integer is a prime number.
2 to the square root of the given number.false if any of them divides the given number, else return true, unless the number is less than 2.