Wrap

Wrap a value to be between two other numbers.

Syntax

value = Wrap (number,valueA,valueB)

Description

This function takes three numbers, the first is a number that is to be wrapped to a value between valueA and valueB inclusive.

The value returned is a value that is 'wrapped' between the two other values e.g.

Wrap(0,0,10) returns 0
Wrap(-1,0,10) returns 10
Wrap(-2,0,10) returns 9
Wrap(11,0,10) returns 0


Table of contents