📄 mathdemo1.java
字号:
public class MathDemo1{
public static void main(String arg[]){
System.out.println("Pi="+Math.PI);
System.out.println("E="+Math.E);
System.out.println("abs(-6.5)="+Math.abs(-6.5));
System.out.println("ceil(-6.3)="+Math.ceil(-6.3));
System.out.println("floor(-6.3)="+Math.floor(-6.3));
System.out.println("round(-6.3)="+Math.round(-6.3));
System.out.println("round(+6.3)="+Math.round(6.3));
System.out.println("round(-6.5)="+Math.round(-6.5));
System.out.println("round(+6.5)="+Math.round(6.5));
System.out.println("round(-6.6)="+Math.round(-6.6));
System.out.println("round(+6.6)="+Math.round(6.6));
System.out.println("max(-6.3,-6)="+Math.max(-6.3,-6));
System.out.println("min(-6.3,-6)="+Math.min(-6.3,-6));
System.out.println("random()="+Math.random());
System.out.println("sqrt(4)="+Math.sqrt(4));
System.out.println("sin(30 degree)="+Math.sin(Math.toRadians(30)));
System.out.println("cos(60 degree)="+Math.cos(Math.toRadians(60)));
System.out.println("tan(45 degree)="+Math.tan(Math.toRadians(45)));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -