Do doubles suffer from overflow?

帅比萌擦擦* 提交于 2019-12-23 16:52:16

问题


Is it possible to have an overflow (wrap around) with a double or a float? What will happen if the maximum (or minimum) value is reached on x86 or x64 hardware?


回答1:


On an IEEE-754 compliant system, overflow results in a special "infinity" (or "minus infinity") value, beyond which any further increment will have no effect.




回答2:


No. Floats go to Inf or -Inf



来源:https://stackoverflow.com/questions/10239741/do-doubles-suffer-from-overflow

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