Java Number Round roundUp(int p_154354_0_, int p_154354_1_)

Here you can find the source of roundUp(int p_154354_0_, int p_154354_1_)

Description

round Up

License

Open Source License

Declaration

public static int roundUp(int p_154354_0_, int p_154354_1_) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int roundUp(int p_154354_0_, int p_154354_1_) {
        if (p_154354_1_ == 0) {
            return 0;
        } else if (p_154354_0_ == 0) {
            return p_154354_1_;
        } else {//www. ja  va  2s  .  c o  m
            if (p_154354_0_ < 0) {
                p_154354_1_ *= -1;
            }

            int i = p_154354_0_ % p_154354_1_;
            return i == 0 ? p_154354_0_ : p_154354_0_ + p_154354_1_ - i;
        }
    }
}

Related

  1. roundUp(int i, int snap)
  2. roundUp(int n, int nearestMultiple)
  3. roundUp(int ndigits)
  4. roundUp(int num, int divisor)
  5. roundUp(int number, int interval)
  6. roundUp(int v, int quant)
  7. roundUp(int val, int shift)
  8. roundUp(int val, int to)
  9. roundUp(int x, int blockSizePowerOf2)