import java.lang.Math;
public class text {
public static void main(String[] args) {
int x = 5;
int y = 2;
double d = 3.14;
// 求x的y次方
double result1 = Math.pow(x, y);
System.out.println("x的y次方为:" + result1);
// 求x和y的最小值
int result2 = Math.min(x, y);
System.out.println("x和y的最小值为:" + result2);
// 求d取整后的结果
int result3 = (int) Math.floor(d);
System.out.println("d取整后的结果为:" + result3);
// 求d四舍五入后的结果
long result4 = Math.round(d);
System.out.println("d四舍五入后的结果为:" + result4);
// 求atan(d)的数值
double result5 = Math.atan(d);
System.out.println("atan(d)的数值为:" + result5);
}
}
three
最新推荐文章于 2024-07-27 13:31:57 发布