isPrime()

Determines if a number is a prime integer.

This function is valid in v2.1.0 to v2.23.0. This function has been downloaded 29 times.

Parameter

{number} num
Number to be tested.

Returns

{boolean}
true if num is a positive integer that is only divisible by itself and 1. Otherwise false.

Required Function

This function directly requires the following function which is included automatically:

  • isSafeInt()
    Determines if the argument that is passed in is an integer in the range of -9007199254740991 and 9007199254740991.

Requiring Function

This function is directly required by the following function:

  • isComposite()
    Determines if a number is a positive integer that is divisible by other integers apart from 1 and itself.