小白教程
所有教程
关于
Search
172.69.59.134
172.69.59.134
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Number pow”的源代码
本页内容
上一节:
Number_log
下一节:
Number_sqrt
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:pow()}}[[Category:java number|16]] = Java pow() 方法 = [[java number|Java Number类]] pow() 方法用于返回第一个参数的第二个参数次方。 === 语法 === <pre> double pow(double base, double exponent) </pre> === 参数 === * '''base''' -- 任何原生数据类型。 * '''exponent''' -- 任何原生数据类型。 === 返回值 === 返回第一个参数的第二个参数次方。 == <sample title="" desc="" lang="java" hererun="1"> 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)); } } </sample> 编译以上程序,输出结果为: <pre> e 的值为 2.7183 pow(11.635, 2.760) 为 874.008 </pre> [[java number|Java Number类]]
返回至“
Number pow
”。
上一节:
Number_log
下一节:
Number_sqrt