Here you can find the source of roundUp(long n, long m)
Parameter | Description |
---|---|
n | the number to round |
m | the number to round to. |
static int roundUp(long n, long m)
//package com.java2s; // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell public class Main { /**/* ww w . jav a2s.c om*/ * Round n up to nearest multiple of m. * * @param n the number to round * @param m the number to round to. * @return the result of the calculation. */ static int roundUp(long n, long m) { return (int) (((n + m - 1) / m) * m); } }