Nodejs Number Lerp isInRange(minRange, maxRange, parameter)

Here you can find the source of isInRange(minRange, maxRange, parameter)

Method Source Code

Object.prototype.isInRange = function (minRange, maxRange, parameter) {
    if (!minRange.isNumber() || !minRange.isInteger()) {
        throwTypeException(parameter);// w  ww .  ja v  a  2s .  co  m
    }

    if (!maxRange.isNumber() || !maxRange.isInteger()) {
        throwRangeException(parameter);
    }

    if (!this.valueOf().isNumber()) {
        throwTypeException(parameter);
    }

    return (minRange < this.valueOf() && this.valueOf() < maxRange);
};

Related

  1. lerp(norm, min, max)
    Math.lerp = function(norm, min, max) {
      return (max - min) * norm + min;
    };