Java Number Round roundUp(long position, long sectionAlignment)

Here you can find the source of roundUp(long position, long sectionAlignment)

Description

round Up

License

Open Source License

Declaration

public static long roundUp(long position, long sectionAlignment) 

Method Source Code

//package com.java2s;

public class Main {
    public static long roundUp(long position, long sectionAlignment) {
        if (sectionAlignment < 0)
            throw new RuntimeException("Bad alignment: " + sectionAlignment);
        if (sectionAlignment == 0)
            sectionAlignment = 1;/*ww  w .ja v a 2  s  . c  o  m*/
        if (position % sectionAlignment != 0)
            return (position - (position % sectionAlignment)) + sectionAlignment;
        return position;
    }
}

Related

  1. roundUp(int val, int shift)
  2. roundUp(int val, int to)
  3. roundUp(int x, int blockSizePowerOf2)
  4. roundUp(long n, long m)
  5. roundUp(long number, long mod)
  6. roundUp(long size, int blockSize)
  7. roundUp(long val, long delta)
  8. roundup_2n(long val, int blocksize)
  9. roundUpDivision(final int dividend, final int divider)