Here you can find the source of roundM(int n, int m)
public static int roundM(int n, int m)
//package com.java2s; //License from project: Open Source License public class Main { public static int roundM(int n, int m) { return (int) (Math.floor((n + m - 1) / m) * m); }/*from w w w. jav a 2s . c o m*/ public static int floor(double x) { return (int) Math.floor(x); } }