Here you can find the source of floorPOT(int n)
public static int floorPOT(int n)
//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; } }