向上取整:Math.ceil(double a)
向下取整:Math.floor(double a)
四舍五入取整:Math.round(double a)
例:
Math.ceil(24.2)–> 25
Math.floor(24.7)–> 24
Math.round(24.2)–> 24
Math.round(24.7)–> 25
向上取整:Math.ceil(double a)
向下取整:Math.floor(double a)
四舍五入取整:Math.round(double a)
例:
Math.ceil(24.2)–> 25
Math.floor(24.7)–> 24
Math.round(24.2)–> 24
Math.round(24.7)–> 25