constrain() \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0024+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name | ### constrain()
Examples |
    int t = constrain(t, 30, 70);  // makes sure t is between the values 30 and 70
Description | Constrains a value to not exceed a maximum and minimum value.
Syntax |
    constrain(value, min, max)
Parameters |
value | int or float: the value to constrain
min | int or float: minimum limit
max | int or float: maximum limit
Returns | float or int (depending on the input values)
Usage | Application
Related | max() min()

Updated on January 11, 2010 09:41:49pm PST