Java: double vs float

后端 未结 6 1204
一整个雨季
一整个雨季 2020-12-09 16:37

In another Bruce Eckel exercise, the code I\'ve written takes a method and changes value in another class. Here is my code:

class Big {
  float b;
}

public         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 16:42

    float range is lower than double so a float can be easily represented in double, but the reverse is not possible because, let say we take a value which is out of float range then during convention we will lose the exact data

提交回复
热议问题