help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Try-Catch block unable to catch exception


From: neonsignal
Subject: Re: Try-Catch block unable to catch exception
Date: Wed, 3 Sep 2008 20:33:21 -0700 (PDT)
User-agent: G2/1.0

Just some more information on this: the message "Floating Point
Exception" does not mean a C++ exception. It actually refers to an
error that has been caught by a processor interrupt (divide by zero).
Different operating systems do provide ways to intercept these, but
this is outside of the language.

Normally with integers you would do the zero checking yourself. It is
painful if you have lots of divisions in your code; you might consider
writing a division function that would check first and throw an
exception. But that is overkill in most instances.

Things behave a bit better with floating point arithmetic, because the
IEEE standard can handle values like infinity and not-a-number without
having to throw errors at all.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]