Java Number Round roundUpToPowerOf2Factor(long val, long factor)

Here you can find the source of roundUpToPowerOf2Factor(long val, long factor)

Description

round Up To Power Of Factor

License

Apache License

Declaration

public static long roundUpToPowerOf2Factor(long val, long factor) 

Method Source Code

//package com.java2s;
// Licensed to the Apache Software Foundation (ASF) under one

public class Main {
    public static long roundUpToPowerOf2Factor(long val, long factor) {
        return (val + (factor - 1)) & ~(factor - 1);
    }/*from   www . j  a  v a 2s  .c o m*/
}

Related

  1. roundUpToNearest(double number, double nearest)
  2. roundUpToNearestEightBytes(long result)
  3. roundUpToNearestPowerOfTwoIfGreaterThanZero(final int value)
  4. roundUpToPowerOf2(int number)
  5. roundUpToPowerOf2(long val)
  6. roundUpToPowerOfTwo(int i)
  7. roundUpToPowerOfTwo(int p_151236_0_)
  8. roundUpToPowerOfTwo(int v)
  9. roundUpToPowerOfTwo(int x)