Java Long Number Align alignUp(long b, long a)

Here you can find the source of alignUp(long b, long a)

Description

Example: alignUp( 700, 512 ) -> 1024

License

Open Source License

Declaration

static public long alignUp(long b, long a) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from   ww w .ja  v a  2  s. com*/
     * Example: alignUp( 700, 512 ) -> 1024
     */
    static public long alignUp(long b, long a) {
        return (long) (Math.ceil((double) b / a) * a);
    }
}

Related

  1. alignLength(int sectorSize, long remoteOffset, long len)
  2. alignOffset(int sectorSize, long fileOffset)
  3. alignQueryTimestampToBaseAggregationTime(long queryTimestamp)
  4. alignSize(long size)
  5. alignSize(long size, long alignment)