Java pow() 方法
Java 教程
· 2019-02-08 13:44:32
pow() 方法用于返回第一个参数的第二个参数次方。
语法
double pow(double base, double exponent)
参数
base -- 任何原生数据类型。
exponent -- 任何原生数据类型。
返回值
返回第一个参数的第二个参数次方。
实例
public class Test{
public static void main(String args[]){
double x = 11.635;
double y = 2.76;
System.out.printf("e 的值为 %.4f%n", Math.E);
System.out.printf("pow(%.3f, %.3f) 为 %.3f%n", x, y, Math.pow(x, y));
}
}
编译以上程序,输出结果为:
e 的值为 2.7183 pow(11.635, 2.760) 为 874.008
点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html
The Tangled Web
Michal Zalewski / No Starch Press / 2011-11-26 / USD 49.95
"Thorough and comprehensive coverage from one of the foremost experts in browser security." -Tavis Ormandy, Google Inc. Modern web applications are built on a tangle of technologies that have been de......一起来看看 《The Tangled Web》 这本书的介绍吧!