Here you can find the source of ceilMultiple(float source, float multiple)
public static float ceilMultiple(float source, float multiple)
//package com.java2s; public class Main { public static float ceilMultiple(float source, float multiple) { if (source > 0) { float tmp = source - 1; return tmp + (multiple - (tmp % multiple)); } else {/*from w w w. j a v a 2 s. c om*/ return source + (-source % multiple); } } }