Java Number Power pow(int base, int exp)

Here you can find the source of pow(int base, int exp)

Description

pow

License

MIT License

Declaration

public static int pow(int base, int exp) 

Method Source Code

//package com.java2s;
/**//from w  w  w. java  2s .co  m
 * Copyright (c) 2014 Sa?l Pi?a <sauljabin@gmail.com>.
 * 
 * This file is part of GeneticAlgorithm.
 * 
 * GeneticAlgorithm is licensed under The MIT License.
 * For full copyright and license information please see the LICENSE file.
 */

public class Main {
    public static int pow(int base, int exp) {
        return exp == 0 ? 1 : pow(base, exp - 1) * base;
    }

    public static long pow(long base, int exp) {
        return exp == 0 ? 1 : pow(base, exp - 1) * base;
    }
}

Related

  1. pow(float[] inData, float rate)
  2. pow(float[][] in)
  3. pow(int a, int b)
  4. pow(int a, int b, int modulus)
  5. pow(int b, int e)
  6. pow(int base, int exp)
  7. pow(int base, int exponent)
  8. pow(int base, int power)
  9. pow(int i, int pow)