Java Number Convert numToPowerOf(int num, int toPowerOf)

Here you can find the source of numToPowerOf(int num, int toPowerOf)

Description

num To Power Of

License

Open Source License

Declaration

public static final int numToPowerOf(int num, int toPowerOf) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static final int numToPowerOf(int num, int toPowerOf) {
        return toPowerOf > 0 ? num << toPowerOf : (toPowerOf < 0 ? num >> toPowerOf : (toPowerOf == 0 ? 1 : num));
    }/*ww w .  ja  v a  2  s  . c o m*/
}

Related

  1. numToBytes(byte[] buffer, long value, int radix)
  2. numToBytes(long value, byte[] b, int off, int len)
  3. numToInt(Number n)
  4. numToIPv4(StringBuilder host)
  5. numToLetter(String input)
  6. numToStringWithOrder(long count)
  7. numToWords(long num)
  8. parseAmountConversionRate(String convRate)