Java Number Min Value minLog2(int input)

Here you can find the source of minLog2(int input)

Description

min Log

License

Open Source License

Declaration

public static int minLog2(int input) 

Method Source Code

//package com.java2s;

public class Main {
    public static int minLog2(int input) {
        int bitMask = 1;
        int bitPosition = 0;
        int maxBitMask = 0;
        while (bitPosition < 31) {
            if ((bitMask & input) > 0) {
                maxBitMask = (bitMask & input);
            }//from w  w  w.  j  a va  2 s  .  c  o  m
            bitMask <<= 1;
            bitPosition++;
        }
        return maxBitMask;
    }
}

Related

  1. minLength(String field, Integer from)
  2. minLength(String value, int min)
  3. minLengthExpression(final String operand, final long minLength)
  4. minLimit(double d, double limit)
  5. minLimit(float value, float min)
  6. minMax(double v, double min, double max)
  7. minMax(int i)
  8. minmax(int min, int max, int now)
  9. minMax(int val, int min, int max)