android_基础_BigDecimal 更精准的计算
转载自: https://blog.csdn.net/JM_beizi/article/details/51775849?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link
问题:为什么要用BigDecimal?
在java 中 1.11+0.9 = 1.2 ? NO result=1.2000000000000002 1.2/3=0.4? NO result=0.39999999999
共有 0 条评论