title: what does C/C++ handler SIGFPE?
body: <p>well, I have searched the articles about SIGFPE ,then I wrote a few tests but it's behavoir is strange. Then I have to post it here to ask for help. Is the GCC/G++ or ISO C++ clearly defined what happens if divide by zero?</p>
  
  <p>1) I searched the article :
  <a href="https://stackoverflow.com/questions/7267838/division-by-zero-does-not-throw-sigfpe">Division by zero does not throw SIGFPE</a>
  it sames the output is inf</p>
  
  <p>2) If I rewrite it as the following:</p>
  
  <pre><code>void signal_handler (int signo) {
      if(signo == SIGFPE) {
        std::cout &lt;&lt; "Caught FPE\n";
      }
  }
  
  int main (void) {
    signal(SIGFPE,(*signal_handler));
  
    int b = 1;
    int c = 0;
    int d = b/c;
    //fprintf(stderr,"d number is %d\n,d);
    return 0;
  }
  </code></pre>
  
  <p>then signal_handler will not happens. but if I uncomment the line</p>
  
  <pre><code>//fprintf(stderr,"d number is %d\n,d);
  </code></pre>
  
  <p>then signal_handler keeps calling.</p>
  
  <p>can someone explains it ?</p>