首页 > 文档 > min() 最小值
2017
07-18

min() 最小值

名称: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

 

相关:

max()



最后编辑:
作者:Hewes
这个作者貌似有点懒,什么都没有留下。

min() 最小值》有 1 条评论

  1. Pingback 引用通告: max() 最大值 | Processing编程艺术

留下一个回复

你的email不会被公开。