One - One Code All

Blog Content

rust数学运算向上取整向下取整

Rust   2017-04-28 10:18:44

Number

  • floor,浮点数向下取整

  • ceil, 浮点数向上取整

  • round,根据中间数向上或向下取值

  • trunc,返回浮点数的整数部分

  • fract, 返回浮点数的小数部分

  • abs,绝对值




上一篇:Rust中的集合类型之vectors
下一篇:Rust编译时卡住waiting for file lock on package cache lock

The minute you think of giving up, think of the reason why you held on so long.