Sha256: b9ea7f44f2f51823d9462ba83c596d848fb5184c0aacbb9f732258754edc249f
Contents?: true
Size: 557 Bytes
Versions: 25
Compression:
Stored size: 557 Bytes
Contents
// `Math.scale` method implementation // https://rwaldron.github.io/proposal-math-extensions/ module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { if ( arguments.length === 0 /* eslint-disable no-self-compare */ || x != x || inLow != inLow || inHigh != inHigh || outLow != outLow || outHigh != outHigh /* eslint-enable no-self-compare */ ) return NaN; if (x === Infinity || x === -Infinity) return x; return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; };
Version data entries
25 entries across 25 versions & 7 rubygems