How do I use try...catch to catch floating point errors?
- by Peter Stewart
I'm using c++ in visual studio express to generate random expression trees for use in a genetic
algorithm type of program.
Because they are random, the trees often generate: divide by zero, overflow, underflow as well as
returning "inf" and other strings. I can write handlers for the strings, but the literature left me
baffled about the others. If I understand it correctly, I have to set some flags first? Advice
and/or a pointer to some literature would be appreciated.