Java Number Power power(int x, int n)

Here you can find the source of power(int x, int n)

Description

Returns x to the power n.

License

Open Source License

Parameter

Parameter Description
x The base
n The exponent

Return

x to the power n.

Declaration

public static int power(int x, int n) 

Method Source Code

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

public class Main {
    /**//from www  .j a  v  a 2s . com
     * Returns x to the power n.
     *
     * @param x The base
     * @param n The exponent
     * @return x to the power n.
     */
    public static int power(int x, int n) {
        return (int) (Math.pow(x, n));
    }
}

Related

  1. power(double d, int exp)
  2. power(final long x, final long n, final long p)
  3. power(int base, int power)
  4. power(int i)
  5. power(int val, int numOfPower)
  6. power(long x, long y)
  7. power2(int power)
  8. powerConverter(String _varSymbol)
  9. powerLevelToDb(double value)