basicmathdemo.java

来自「JAVA 工作指南 可以说是程序员必备的东西哦」· Java 代码 · 共 17 行

JAVA
17
字号
public class BasicMathDemo {    public static void main(String[] args) {        double a = -191.635;        double b = 43.74;        int c = 16, d = 45;        System.out.printf("The absolute value of %.3f is %.3f%n", a, Math.abs(a));        System.out.printf("The ceiling of %.2f is %.0f%n", b, Math.ceil(b));        System.out.printf("The floor of %.2f is %.0f%n", b, Math.floor(b));        System.out.printf("The rint of %.2f is %.0f%n", b, Math.rint(b));        System.out.printf("The max of %d and %d is %d%n",c, d, Math.max(c, d));        System.out.printf("The min of of %d and %d is %d%n",c, d, Math.min(c, d));                    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?