Discussion:
SIGFPE
(too old to reply)
Fred J. Tydeman
2024-10-23 05:10:30 UTC
Permalink
Anyone know of any implementations that use SIGFPE?
If so, how is it used?
---
Fred J. Tydeman Tydeman Consulting
***@tybor.com Testing, numerics, programming
+1 (702) 608-6093 Vice-chair of INCITS/C (ANSI "C")
Sample C17+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.
Andrey Tarasevich
2024-10-23 07:42:12 UTC
Permalink
Post by Fred J. Tydeman
Anyone know of any implementations that use SIGFPE?
If so, how is it used?
#include <limits.h>

int main(void)
{
int a = INT_MIN, b = -1;
return a / b;
}

https://godbolt.org/z/GnYsnTWWd

Program terminated with signal: SIGFPE
--
Best regards,
Andrey
Fred J. Tydeman
2024-10-24 17:01:33 UTC
Permalink
Post by Fred J. Tydeman
Anyone know of any implementations that use SIGFPE?
If so, how is it used?
Oops. I see I asked the wrong question.

Anyone know of any implementations where the standard library functions use SIGFPE?
If so, how is it used?

---
Fred J. Tydeman Tydeman Consulting
***@tybor.com Testing, numerics, programming
+1 (702) 608-6093 Vice-chair of INCITS/C (ANSI "C")
Sample C17+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.
James Kuyper
2024-10-24 17:27:34 UTC
Permalink
Post by Fred J. Tydeman
Anyone know of any implementations where the standard library functions use SIGFPE?
...

"... the functions in <math.h> ... Each function shall execute as if it
were a single operation without raising SIGFPE ..." (7.12.1p1).

Fred J. Tydeman
2024-10-24 17:05:11 UTC
Permalink
Post by Andrey Tarasevich
Post by Fred J. Tydeman
Anyone know of any implementations that use SIGFPE?
If so, how is it used?
#include <limits.h>
int main(void)
{
int a = INT_MIN, b = -1;
return a / b;
}
https://godbolt.org/z/GnYsnTWWd
Program terminated with signal: SIGFPE
I see I asked the wrong question.
Anyone know of any standard C libaray implementations that use SIGFPE?
If so, how is it used?
---
Fred J. Tydeman Tydeman Consulting
***@tybor.com Testing, numerics, programming
+1 (702) 608-6093 Vice-chair of INCITS/C (ANSI "C")
Sample C17+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.
Loading...