Do doubles suffer from overflow?
-
01-06-2021 - |
Question
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?
Solution
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.
OTHER TIPS
No. Floats go to Inf
or -Inf
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow