Clip
Details
- Clip[x] is effectively equivalent to Piecewise[{{-1,x<-1},{+1,x>+1}},x].
- The vi, as well as other arguments of Clip, need not be numbers.
- For exact numeric quantities, Clip internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
Examples
open all close allBasic Examples (3)
Scope (28)
Numerical Evaluation (5)
Clip[7.5]Clip[-5 / 2, {-2, 2}]Clip[Pi, {-9, 7}, {11, 28}]N[Clip[1 / 11, {1 / 7, 5}], 50]The precision of the output tracks the precision of the input:
Clip[8, {-9, 7.111111111111111111111}]Evaluate efficiently at high precision:
Clip[1 / 8, {1 / 17, 1 / 11`100}]//TimingClip[91 / 1131, {92 / 173, 72 / 531`100000000}];//TimingClip threads over lists in its first argument:
Clip[{-2, 0, 2}]Compute average-case statistical intervals using Around:
Clip[ Around[-5, 0.01], {2, 5}]Specific Values (5)
Values of Clip at fixed points:
Table[Clip[n ], {n, {1 / 7, 1 / 3, 5 / 2, π}}]Clip[0]Clip[∞]PiecewiseExpand[Clip[x, {0, 4}]]PiecewiseExpand[Clip[x, {0, 4}, {0, 2}]]Find a value of x for which the Clip[x,{-2,2}]=1:
xval = x /. FindRoot[Clip[x, {-2, 2}] == 1, {x, 1.5}]Plot[Clip[x, {-2, 2}], {x, -5, 5}, Epilog -> Style[Point[{xval, Clip[xval, {-2, 2}]}], PointSize[Large], Red]]Visualization (3)
Visualize the three-argument form of Clip:
Plot[Clip[x, {0, 2}, {-E, Pi}], {x, -5, 5}]Plot the composition of Clip with a periodic function:
Plot[Clip[Sin[x], {-(1/2), 1}], {x, -2π, 2π}]Plot Clip in three dimensions:
Plot3D[Clip[x + y], {x, -3, 3}, {y, -3, 3}, ColorFunction -> "BlueGreenYellow"]Function Properties (9)
Clip is defined for all real inputs:
FunctionDomain[Clip[x], x]FunctionDomain[Clip[x, {min, max}, {vmin, max}], {x, min, max, vmin, max}]It is restricted to real inputs:
FunctionDomain[Clip[x], x, Complexes]Function range of Clip[x]:
FunctionRange[Clip[x], x, y]Range of Clip[x,{min,max},{vmin,vmax}]:
FunctionRange[Clip[x, {min, max}, {vmin, vmax}], x, y]//SimplifyThe single-argument form of Clip is an odd function:
FullSimplify[Clip[-x] == -Clip[x]]This is not true, in general, of the two- and three-argument forms:
Clip[-2, {0, 1}] == -Clip[2, {0, 1}]Clip is not an analytic function:
FunctionAnalytic[Clip[x], x]Clip[x] has singularities but no discontinuities:
FunctionSingularities[Clip[x], x]FunctionDiscontinuities[Clip[x], x]The three-argument form may have discontinuities:
FunctionDiscontinuities[Clip[x, {min, max}, {vmin, max}], x]Clip[x] is nondecreasing:
FunctionMonotonicity[Clip[x], x]Clip[x] is not injective:
FunctionInjective[Clip[x], x]Plot[{Clip[x], 1}, {x, -4, 4}]Clip[x] is not surjective:
FunctionSurjective[Clip[x], x]Plot[{Clip[x], -2.5}, {x, -4, 4}]Clip[x] is neither non-negative nor non-positive:
FunctionSign[Clip[x], x]Clip[x] is neither convex nor concave:
FunctionConvexity[Clip[x], x]Differentiation and Integration (6)
First derivative with respect to x:
D[Clip[x], x]//SimplifyFirst and second derivatives with respect to x:
Table[D[Clip[x, {-2, 2}, {-∞, ∞}], {x, k}], {k, 1, 2}]//FullSimplifyFormula for the ![]()
derivative with respect to x:
D[Clip[x], {x, k}]// PiecewiseExpandCompute the indefinite integral using Integrate:
Integrate[Clip[x], x]FullSimplify[D[%, x] == Clip[x]]Integrate[Clip[x], {x, 0, 3}]Integrate[Clip[(1/x - 1)], x]Integrate[x ^ 2Clip[x], {x, 0, 10}]Applications (1)
Possible Issues (1)
Clip is not defined for complex values:
Clip[2 - 3I]Clip the real and imaginary parts separately:
Clip[Re[2 - 3I]] + Clip[Im[2 - 3I]]ITech Notes
History
Introduced in 2004 (5.1)
Text
Wolfram Research (2004), Clip, Wolfram Language function, https://reference.wolfram.com/language/ref/Clip.html.
CMS
Wolfram Language. 2004. "Clip." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Clip.html.
APA
Wolfram Language. (2004). Clip. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Clip.html
BibTeX
@misc{reference.wolfram_2026_clip, author="Wolfram Research", title="{Clip}", year="2004", howpublished="\url{https://reference.wolfram.com/language/ref/Clip.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_clip, organization={Wolfram Research}, title={Clip}, year={2004}, url={https://reference.wolfram.com/language/ref/Clip.html}, note=[Accessed: 13-June-2026]}