创客百科

姿势共享,有节操无门槛参与的创客百科,创客动力之源 \ (^_^) /

用户工具

站点工具


arduino:language:trunc

trunc()

例子

double c = trunc(-3.5);  // Sets c to -3
double d = trunc(2.7172);  // Sets d to 2

描述

trunc()返回不大于x绝对值的最近的正数。

语法

trunc(x)

参数

x double, float or int

返回 double

本页面的其他翻译:
arduino/language/trunc.txt · 最后更改: 2016/12/25 22:15 (外部编辑)