Why does using modulo on non-integer values lose floating-point precision? [duplicate]

旧城冷巷雨未停 提交于 2019-12-02 08:14:02

Float and double are imprecise - they have a finite amount of bits to represent a value.

Because humans use base 10, and computers use base 2, numbers that appear "simple" to us can be impossible to represent accurately as a float/double, especially the results of computations due to way CPUs execute them.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!