Here you can find the source of roundUp(int groupSize, int globalSize)
Parameter | Description |
---|---|
groupSize | a parameter |
globalSize | a parameter |
public static int roundUp(int groupSize, int globalSize)
//package com.java2s; /*//from w ww .j a v a 2s . co m * Copyright (C) 2010-2014 Andreas Maier * CONRAD is developed as an Open Source project under the GNU General Public License (GPL). */ public class Main { /** * rounded up to the nearest multiple of the groupSize * @param groupSize * @param globalSize * @return the rounded value */ public static int roundUp(int groupSize, int globalSize) { int r = globalSize % groupSize; if (r == 0) { return globalSize; } else { return globalSize + groupSize - r; } } }