集册 Java实例教程 演示数学功能使用的程序

演示数学功能使用的程序

欢马劈雪     最近更新时间:2020-01-02 10:19:05

495
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
演示数学功能使用的程序

public class Main{//nowjava - 时代Java 提 供

    public static void main(String[] args) {

        int q = 2 / 3;

        double qq = 2 / 3;

        double qqq = 2 / 3.0;


        System.out.println(7 + (9 * 6));


        System.out.println(q);

        System.out.println(qq);

        System.out.println(qqq);



        double x = Math.E;

        double fx = Math.log(x);

        System.out.print("Is this precisely 1 or is there numerical errors? ");

        System.out.println(fx);



        x = Math.PI / 15.0;

        System.out.println("x : " + x);

        fx = Math.sin(x) * Math.sin(x) + Math.cos(x) * Math.co
展开阅读全文