Java tutorial
//package com.java2s; public class Main { /** * @param delta * @return */ private static int getNumBits(final long delta) { return Long.SIZE - Long.numberOfLeadingZeros(delta); } }