clamp

Synopsis

float clamp(float x, float min, float max)

Parameters

Returns

returns min if x is less than min, max if x is greater than max, and x otherwise.

This function clamps x to the range [min, max].

Related

Examples

example.1
	clamp(1.5, 0, 1)
	# result = 1

example.2
	clamp(-11, -10, 10)
	# result = -10
    

Copyright ©2008-2017 Esri R&D Center Zurich. All rights reserved.