java基础回顾

1、double float精度

      float money = 1.1f;
        double moneydouble  = money;
        System.out.println(moneydouble);//结果为t 1.100000023841858 等等
        System.out.println(1f == 0.99999999f); //结果为true
        System.out.println( 0.2 + 0.7);//结果为t0.8999999999999999
        float f2 = 84552631f;
        for (int i = 0; i < 10; i++) {
            System.out.println(f2); //结果为8.4552632E7
            f2++;
        }    
View Code

 

posted @ 2020-04-11 15:44  yaohuiqin  阅读(114)  评论(0编辑  收藏  举报