Skip to content

moduloBetweenUp

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/dot/blob/main/js/util/moduloBetweenUp.ts for the most up-to-date information.

Overview

Returns a number in the range \(n\in(\mathrm{min},\mathrm{max}]\) with the same equivalence class as the input value mod (max-min), i.e. for a value \(m\), \(m\equiv n\ (\mathrm{mod}\ \mathrm{max}-\mathrm{min})\).

The 'up' indicates that if the value is equal to min or max, the min is returned.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Source Code

See the source for moduloBetweenUp.ts in the dot repository.