Precision lost in float value using java

后端 未结 5 1127
醉酒成梦
醉酒成梦 2020-12-03 16:15

Given below the test code and its output. When I get float value from number value, precision is lost.. Can anyone tell me why this behaviour and also how to handle this?

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 16:48

    3.4028235E38 is greater than 676543.2. Float.MAX_VALUE is the largest float that is possible to represent.

提交回复
热议问题