Here's the case that caused me to investigate and add this change in the first place:

% $PERL-5.34.0 -MMath::GMP -wle 'local $SIG{FPE} = sub { die "fpe" }; +$z=Math::GMP->new(1); print $z / 0' Maximal count of pending signals (120) exceeded at -e line 1. fpe at -e line 1. % % $PERL-5.36.0 -MMath::GMP -wle 'local $SIG{FPE} = sub { die "fpe" }; +$z=Math::GMP->new(1); print $z / 0' fpe at -e line 1. %

The original ticket was Catching SIGFPE. Not sure why my example above isn't reproducing that, but in my real-world code this was stopping me from getting a stack trace to find where the division by zero was occurring.

Despite the name, this exception is primarily raised for integer division by zero, so the Inline::C example needs s{float}{int}g to show it. See why was sigfpe used for integer arithmetic exceptions for some more detail.

Perl itself catches these when it performs a division, so you'll only see it from non-perl code linked to your program.


In reply to Re: FPE not deferred in 5.36 by hv
in thread FPE not deferred in 5.36 by choroba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.