Core Function Wrap

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> Clamp( <value>, <min>, <max> ) </pre> === Description === Clamps the specified value. === Parameters === ==== value ==== Number to check. ==== min ==== The min. ===...")
 
m (1 revision)
 
(One intermediate revision by one user not shown)

Latest revision as of 12:37, 14 June 2015

Clamp( <value>, <min>, <max> )

Contents

Description

Clamps the specified value.

Parameters

value

Number to check.

min

The min.

max

The max.

Return Value

Result of the wrapping.

Remarks

If any of the 3 values are a floating point then the Wrap() will compare as a floating point otherwise it will compare as an integer.

Example

say Wrap(4, 5, 20); // 19
say Wrap(5, 5, 20); // 5
say Wrap(6, 5, 20); // 6
say Wrap(18, 5, 20); // 18
say Wrap(20, 5, 20); // 20
say Wrap(21, 5, 20); // 6
say Wrap(22, 5, 20); // 7
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox