Function clamp

  • Clamp a number between lower and upper bounds.

    Parameters

    • n: number

      Number to clamp.

    • min: number

      Lower bound.

    • max: number

      Upper bound.

    Returns number

    Clamped value