该方法返回参数的平方根。
double sqrt(double d)
这是参数的详细信息-
d - 任何原始数据类型。
public class Test { public static void main(String args[]) { double x=11.635; double y=2.76; System.out.printf("The value of e is %.4f%n", Math.E); System.out.printf("sqrt(%.3f) is %.3f%n", x, Math.sqrt(x)); } }
这将产生以下输出-
链接:https://www.learnfk.comhttps://www.learnfk.com/java/number-sqrt.html
来源:LearnFk无涯教程网
The value of e is 2.7183 sqrt(11.635) is 3.411
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)