Java floor floorPOT(int n)

Here you can find the source of floorPOT(int n)

Description

floor POT

License

Open Source License

Declaration

public static int floorPOT(int n) 

Method Source Code

//package com.java2s;

public class Main {
    public static int floorPOT(int n) {
        return ceilMaskPOT(n) + 1 >>> 1;
    }/*from   w w  w.j  a  v a2s  . c o  m*/

    public static int ceilMaskPOT(int n) {
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        return n;
    }
}

Related

  1. floorModulo(int value, int divisor)
  2. floorPlaneAndHorizToPlanView(final int[][] frameCells, final short frame[], final int h)
  3. floorPlaneToPlanView(int[][] frameCells, final int h)
  4. floorPositive(float value)
  5. floorPot(float value)
  6. floorPowerOf2(final int n)
  7. floorPowerOf2(final int x)
  8. floorPowerOf2(int n)
  9. floorPowerOfTwo(final int a)