Java Number Power pow2(int c)

Here you can find the source of pow2(int c)

Description

pow

License

Apache License

Declaration

public static int pow2(int c) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int pow2(int c) {
        assert c > 0;
        c--;/* w  ww  .  j  a  va 2s  .com*/
        c |= c >> 1;
        c |= c >> 2;
        c |= c >> 4;
        c |= c >> 8;
        c |= c >> 16;
        c++;
        return c;
    }
}

Related

  1. pow2(double num)
  2. pow2(double x, int n)
  3. pow2(final int a)
  4. pow2(final int n)
  5. pow2(final int x)
  6. pow2(int i)
  7. pow2(long x)
  8. Pow2(Object in, double val)
  9. pow2ByteIndex(final int x)