Round操作

浮点数转整型

说明参考:MSDN

round up
Adds 5e-n to the number being rounded, where n is the number of fractional digits in the number.
向上取整

round down
Subtracts 5e-n from the number being rounded, where n is the number of fractional digits in the number.
向下取整

round toward-zero
The same as round down when the number being rounded is positive; otherwise, the same as round up.
取整方向从数轴两端到原点

round away-toward-zero
The same as round up when the number being rounded is positive; otherwise, the same as round down .

round nearet
四舍五入

你可能感兴趣的:(C/C++)