Here you can find the source of divideToCeil(int numerator, int denominator)
Parameter | Description |
---|---|
numerator | the numerator. |
denominator | the denominator. |
public static int divideToCeil(int numerator, int denominator)
//package com.java2s; public class Main { /**/* www.j a v a 2s.c om*/ * Performs a division and rounds upwards to the next integer. * * @param numerator the numerator. * @param denominator the denominator. * @return an integer value. */ public static int divideToCeil(int numerator, int denominator) { Double result = Math.ceil((double) numerator / denominator); return result.intValue(); } }