Java Power of 2 nextPower(int v, int power)

Here you can find the source of nextPower(int v, int power)

Description

next Power

License

Open Source License

Declaration

public static int nextPower(int v, int power) 

Method Source Code

//package com.java2s;

public class Main {
    public static int nextPower(int v, int power) {
        int result = 1;
        while (result < v) {
            result *= power;/*from w  ww .  j a v  a  2 s.c  o m*/
        }
        return result;
    }
}

Related

  1. nextPower2(int n)
  2. nextPowerOf2(final int n)
  3. nextPowerOf2(int n)
  4. nextPowerOf2(int n)