数学运算_基本_01

C++版:http://www.cnblogs.com/cppskill/p/7133156.html

 

1、浮点数 取整数部分

  Trunc

  C++中:直接强制转换即可

2、向下取整 (往值小的方向取) (注意 负数的时候也是往值小的方向取)

  floor  (uses Math;)

  C++中:floor  (#include <math.h>)

3、向上取整 (往值大的方向取) (注意 负数的时候也是往值大的方向取)

  ceil  (uses Math;)

  C++中:ceil  (#include <math.h>)

4、

5、

posted @ 2017-07-07 17:08  CodeSkill  阅读(185)  评论(0编辑  收藏  举报