Function clamp

  • Clamp each element of vector between min and max

    Type Parameters

    Parameters

    • v: BaseArgType

      Operand vector.

    • min: number = 0

      Max value, default 1

    • max: number = 1

      Min value, default 0

    • Optional dst: T

      vector to hold result. If not passed in a new one is created.

    Returns T

    A vector that the clamped value of each element of v.