Java Number Round roundUp(long n, long m)

Here you can find the source of roundUp(long n, long m)

Description

Round n up to nearest multiple of m.

License

Open Source License

Parameter

Parameter Description
n the number to round
m the number to round to.

Return

the result of the calculation.

Declaration

static int roundUp(long n, long m) 

Method Source Code

//package com.java2s;
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

public class Main {
    /**/*  ww w . jav a2s.c om*/
     * Round n up to nearest multiple of m.
     *
     * @param n the number to round
     * @param m the number to round to.
     * @return the result of the calculation.
     */
    static int roundUp(long n, long m) {
        return (int) (((n + m - 1) / m) * m);
    }
}

Related

  1. roundUp(int p_154354_0_, int p_154354_1_)
  2. roundUp(int v, int quant)
  3. roundUp(int val, int shift)
  4. roundUp(int val, int to)
  5. roundUp(int x, int blockSizePowerOf2)
  6. roundUp(long number, long mod)
  7. roundUp(long position, long sectionAlignment)
  8. roundUp(long size, int blockSize)
  9. roundUp(long val, long delta)