warp.clamp ========== .. currentmodule:: warp._src.lang .. function:: clamp(x: Scalar, low: Scalar, high: Scalar) -> Scalar .. wp-function-tags:: :kernel: true :python: true :differentiable: true Clamp the value of ``x`` to the range [low, high]. Equivalent to ``wp.min(wp.max(low, x), high)``. On float types this means NaN values of ``x`` produce ``wp.min(low, high)`` rather than propagating NaN.