正在浏览:余数

// 向上取整 var ceil = Math.ceil(5 / 2) console.log(‘++++++++++’, ceil) // 3 // 向下取整 var floor = Math.floor(5 / 2) console.log(‘———-‘, floor) // 2 // 四舍五入 var round1 = Math.round(5 / 2), round2 = Math.round(10 / 3)