Description Of BigDecimal: pow(int n)
The java.math.BigDecimal.pow(int n) returns a BigDecimal whose value is (thisn ) , The power is computed exactly, to unlimited precision.The parameter n must be in the range 0 through 999999999, inclusive. ZERO.pow(0) returns ONE . Note that future releases may expand the allowable exponent range of this method.
BigDecimal.pow(int n) method returns thisn
Code Example Java BigDecimal
import java.math.BigDecimal;
public class BigDecimalExam {
public static void main(String[] args) {
BigDecimal bg1 = new BigDecimal("2.242");
BigDecimal bg2 = bg1.pow(2);
System.out.println(bg2);
}
}
ไม่มีความคิดเห็น :
แสดงความคิดเห็น