BIS fnc clamp: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Fix return value) |
m (Text replacement - "\[\[Category\:Function Group\: Math(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "") |
||
Line 26: | Line 26: | ||
|seealso= [[:Category:Function Group: Math]] [[:Category:Command Group: Math]] | |seealso= [[:Category:Function Group: Math]] [[:Category:Command Group: Math]] | ||
}} | }} | ||
Revision as of 13:59, 12 October 2020
Description
- Description:
- Clamps provided value within min..max range.
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- [value, min, max] call BIS_fnc_clamp
- Parameters:
- value: Number - value to be clamped
- min: Number - (Optional, default 0) lower limit
- max: Number - (Optional, default 0) upper limit
- Return Value:
- Number - the clamped value
Examples
- Example 1:
[5, 0, 10] call BIS_fnc_clamp; // returns 5 [0, 0, 10] call BIS_fnc_clamp; // returns 0 [10, 0, 10] call BIS_fnc_clamp; // returns 10 [-5, 0, 10] call BIS_fnc_clamp; // returns 0 [15, 0, 10] call BIS_fnc_clamp; // returns 10 [5, 10, 3] call BIS_fnc_clamp; // returns 10
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note