pacman()

Confines a number to a specified range by looping number that are too large back to the beginning of the range and numbers that are too small back to the end of the range (just like in Pacman).

This function is valid in v2.14.1 to v2.24.3. This function has been downloaded 75 times.

Parameters

{number} x
The number that you want to confine to the specified range.
{number} inclusive
An extreme of the range to which to confine x. This number IS included in the range of valid numbers.
{number} exclusive
An extreme of the range to which to confine x. This number IS NOT included in the range of valid numbers. If x is equal to this number, inclusive will be returned from this function.

Returns

{number}
A number representing x within the range inclusive and exclusive where x can be inclusive but cannot be exclusive.

Requiring Function

This function is directly required by the following function:

  • paginate()
    Makes an array of objects by grouping the array values by page. Similar to indexPages() but includes the items property in each object.