Flush to Zero when a computation results in a denormal number in linux
A computation in my C code is producing a gradual underflow, and when it happens the program is terminating with SIGFPE. How can I flush the result to zero when a gradual underflow (Denormal) results from a computation, and not terminate the execution? (I am working on a redhat linux machine). Thanks. You haven't specified the architecture - I'm going to take a guess that it's a relatively recent x86[-64], in which case you can manipulate the SSE control register using _mm_getcsr , _mm_setcsr , specified in the <xmmintrin.h> (or <immintrin.h> ) header. The 'flush-to-zero' bit is set with