Here you can find the source of ceilToBase(int number, int base)
public static int ceilToBase(int number, int base)
//package com.java2s; //License from project: Open Source License public class Main { public static int ceilToBase(int number, int base) { if (base == 0) { return 0; }//from w w w .ja va 2 s. c o m if (number == 0) { return base; } if (number < 0) { base *= -1; } final int mod = number % base; if (mod == 0) { return number; } return (number + base) - mod; } }