min()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

min()

示例

int d = min(5, 9);



  //Sets 'd' to 5
int e = min(-4, -12);



   // Sets 'e' to -12float 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 
描述 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) min(list)
参数
a int, orfloat: first number
b int, orfloat: second number
c int, orfloat: third number
list float[], or
int[]: array of numbers to compare
返回值 float or int
相关 max()

Updated on October 2, 2018 05:02:06pm EDT

min()