Here you can find the source of power(double d, int exp)
public static double power(double d, int exp)
//package com.java2s; public class Main { public static double power(double d, int exp) { double r = 1; for (int x = 0; x < exp; x++) { r *= d;//from ww w. j av a2 s .co m } return r; } }