Java中对小数的向下取整,向上取整

  • 向上取整用Math.ceil(double a)  即0.5 变成 1

  • 向下取整用Math.floor(double a) 即0.5 变成 0

  • 支持多种数据类型,支持除法运算后的结果