floor()

本参考资料用于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.

名称

floor()

示例
float x = 2.88;

 
int
a = floor(x);

// Sets 'a' to 2 
描述 Calculates the closest
int value that is less than or equal to the value of the parameter.
语法
floor(n)
参数
n float: number to round down
返回值 int
相关 ceil()
round()

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

floor()