名称:min()
例子:
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
描述:
确定数字序列中的最小值,然后返回该值。 min()接受两个或三个float或int值作为参数,或任意长度的数组。
语法:
min(a, b) min(a, b, c) min(list)
参数:
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 用于比较的数组 |
返回:float or int
相关:
- 本文固定链接: http://iprocessing.cn/2017/07/18/min-最小值/
- 转载请注明: Hewes 于 Processing编程艺术 发表
Pingback 引用通告: max() 最大值 | Processing编程艺术