Here you can find the source of divCeil(int nNumerator, int nDenominator)
ceil (nNumerator / nDenominator)
.
Parameter | Description |
---|---|
nNumerator | The numerator |
nDenominator | The denomiator |
ceil (nNumerator / nDenominator)
public static int divCeil(int nNumerator, int nDenominator)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Matthias-M. Christen, University of Basel, Switzerland. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * /*from w ww. j a va 2 s. co m*/ * Contributors: * Matthias-M. Christen, University of Basel, Switzerland - initial API and implementation ******************************************************************************/ public class Main { /** * Returns * <code>ceil (<var>nNumerator</var> / <var>nDenominator</var>)</code>. * * @param nNumerator * The numerator * @param nDenominator * The denomiator * @return <code>ceil (<var>nNumerator</var> / <var>nDenominator</var>)</code> */ public static int divCeil(int nNumerator, int nDenominator) { return (nNumerator + nDenominator - 1) / nDenominator; } }