Java Number Power pow(long n, long pow)

Here you can find the source of pow(long n, long pow)

Description

pow

License

Open Source License

Declaration

public static long pow(long n, long pow) 

Method Source Code

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

public class Main {
    public static long pow(long n, long pow) {
        if (pow == 0) {
            return 1;
        }//from  w w  w  .ja  v  a2 s .  c  o m
        long retval = n;
        for (long i = 2; i <= pow; i++) {
            retval *= n;
        }
        return retval;
    }
}

Related

  1. pow(int value, int exp)
  2. pow(int x, int y)
  3. pow(int[] arr, double p)
  4. pow(Integer a, Integer b)
  5. pow(long base, long exp)
  6. pow(long value, long pow)
  7. pow(Number x, Number exponent)
  8. pow(String str, int n)
  9. pow10(final int exponent)