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.22.1. This function has been downloaded 40 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.