Sha256: 688dfb9dbfb6672388b91b7509a38bc0b03609a8ea0566194934f9d0da364c9b
Contents?: true
Size: 684 Bytes
Versions: 82
Compression:
Stored size: 684 Bytes
Contents
// https://rwaldron.github.io/proposal-math-extensions/ module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { if ( arguments.length === 0 // eslint-disable-next-line no-self-compare || x != x // eslint-disable-next-line no-self-compare || inLow != inLow // eslint-disable-next-line no-self-compare || inHigh != inHigh // eslint-disable-next-line no-self-compare || outLow != outLow // eslint-disable-next-line no-self-compare || outHigh != outHigh ) return NaN; if (x === Infinity || x === -Infinity) return x; return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; };
Version data entries
82 entries across 38 versions & 8 rubygems