名称:round()
例子:
float x = 9.2; int rx = round(x); // Sets 'rx' to 9 float y = 9.5; int ry = round(y); // Sets 'ry' to 10 float z = 9.9; int rz = round(z); // Sets 'rz' to 10 |
描述:
计算最接近参数n的整数。 例如,round(133.8)返回值134。
语法:
round(n)
参数:
|
返回: int
相关:
- 本文固定链接: http://iprocessing.cn/2017/07/18/round-四舍五入/
- 转载请注明: Hewes 于 Processing编程艺术 发表
Pingback 引用通告: floor() 去位取整 | Processing编程艺术