I have a complex model written in C ++ where denominators sometimes turn out to be zeros. I usually test them, but when I forget, it's a pain to debug them, as the model continues without warning.
Is there a compiler flag that works both in recent versions of gcc on linux and on MinGW on windows that I can use to tell gcc to compile to raise a runtime error when division by zero (between pairs) occurs? Is it computationally expensive (to enable it only in debug builds)?
I am aware of a similar question that was posted here , but the answers are more likely a combination of technical and theoretical quick comments, rather than a developed answer.
source
share