Here you can find the source of divUp(int dividend, int divisor)
Parameter | Description |
---|---|
dividend | a parameter |
divisor | a parameter |
public static int divUp(int dividend, int divisor)
//package com.java2s; /*//from www. java 2 s . c o m * Big Database Semantic Metric Tools * * Copyright (C) 2011 OpenLink Software <bdsmt@openlinksw.com> * All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; only Version 2 of the License dated * June 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ public class Main { /** divides integers with rounding up * @param dividend * @param divisor * @return quotient rounded to upper integer */ public static int divUp(int dividend, int divisor) { return (dividend + divisor - 1) / divisor; } }