This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.



int d = min(5, 9);            // Sets 'd' to 5
int e = min(-4, -12);         // Sets 'e' to -12
float f = min(12.3, 230.24);  // Sets 'f' to 12.3

int[] values = { 5, 1, 2, -3 };  // Create an array of ints
int h = min(values);             // Sets 'h' to -3
Description Determines the smallest value in a sequence of numbers, and then returns that value. min() accepts either two or three float or int values as parameters, or an array of any length.
min(a, b)
min(a, b, c)
a int, or float: first number
b int, or float: second number
c int, or float: third number
list float[], or int[]: array of numbers to compare
Returnsfloat or int
Updated on July 25, 2014 01:11:32pm EDT

Creative Commons License