countSteps.js 266 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /** * Count number of full steps. */ function countSteps(val, step, overflow){ val = Math.floor(val / step); if (overflow) { return val % overflow; } return val; } module.exports = countSteps;