33 * @param {number } modulus - the modulus of division
44 * @param {number } [anchor=0] - controls the offset of multiples of modulus. For example, with a modulus of 3
55 * and an anchor of 1, possible return values include -2, 1, 4, 7, etc.
6- * @return the greatest (closest to positive infinity) multiple of modulus that is <= value.
6+ * @return the greatest (closest to positive infinity) multiple of modulus, plus anchor, that is <= value.
77 */
88function modFloor ( value , modulus , anchor ) {
99 if ( anchor ) return anchor + modFloor ( value - anchor , modulus )
@@ -17,7 +17,7 @@ function modFloor(value, modulus, anchor) {
1717 * @param {number } modulus - the modulus of division
1818 * @param {number } [anchor=0] - controls the offset of multiples of modulus. For example, with a modulus of 3
1919 * and an anchor of 1, possible return values include -2, 1, 4, 7, etc.
20- * @return the least (closest to negative infinity) multiple of modulus that is >= value.
20+ * @return the least (closest to negative infinity) multiple of modulus, plus anchor, that is >= value.
2121 */
2222function modCeiling ( value , modulus , anchor ) {
2323 if ( anchor ) return anchor + modCeiling ( value - anchor , modulus )
@@ -33,7 +33,7 @@ function modCeiling(value, modulus, anchor) {
3333 * @param {number } modulus - the modulus of division
3434 * @param {number } [anchor=0] - controls the offset of multiples of modulus. For example, with a modulus of 3
3535 * and an anchor of 1, possible return values include -2, 1, 4, 7, etc.
36- * @return the greatest (closest to positive infinity) multiple of modulus that is < value.
36+ * @return the greatest (closest to positive infinity) multiple of modulus, plus anchor, that is < value.
3737 */
3838function modLower ( value , modulus , anchor ) {
3939 var result = modFloor ( value , modulus , anchor )
@@ -45,7 +45,7 @@ function modLower(value, modulus, anchor) {
4545 * @param {number } modulus - the modulus of division
4646 * @param {number } [anchor=0] - controls the offset of multiples of modulus. For example, with a modulus of 3
4747 * and an anchor of 1, possible return values include -2, 1, 4, 7, etc.
48- * @return the least (closest to negative infinity) multiple of modulus that is > value.
48+ * @return the least (closest to negative infinity) multiple of modulus, plus anchor, that is > value.
4949 */
5050function modHigher ( value , modulus , anchor ) {
5151 var result = modCeiling ( value , modulus , anchor )
0 commit comments