I seem to remember at a previous job, when tracking down a certain bug I added a call to a function that made sure that floating point errors got reported in some way. I don’t remember exactly how – probably a callback, or maybe it caused a break in Visual Studio immediately when it happened.
Tried searching for this but got nothing. Does this ring a bell for anyone? This is for a Windows game, if that matters.
(I’m not talking about enabling first-chance exceptions in Visual Studio, I want to catch it “live” as well).
It’s called the floating-point environment. References:
To get exceptions to immediately halt your program, use platform-specific functions: