3 ms·
Just because some people decided to label floating point overflow conditiona as "infinity" doesn't mean it can actually represent values up to infinity. There
by Karliss 4y ago
Just because some people decided to label floating point overflow conditiona as "infinity" doesn't mean it can actually represent values up to infinity.
There are ways of getting floating point infinity which doesn't involve overflow like dividing by there. But with exception of most trivial cases you have the same problem. You can't know whether you had actual 0 or value closer to 0 than what floating point can represent.
All of that of course depends on how floating point unit or calculation environment is configured. It's probably possible to configure it so that overflows/underflows report an error instead of simply returning "inf".