对x进行四舍五入以使其可被m整除的最简单方法是什么?例如,if x = 114, m =4, then the round up should be 116 要么if x = 119, m=5, then the round up should be 120 最佳答案 roundUp <- function(x,m) m*ceiling(x / m) roundUp(119,5) roundUp(114,4)