• Clamps value to [0, 1] range. NaN values are converted to 0.

    Parameters

    • x: number

      The number to clamp.

    Returns number