diff options
author | Guido van Rossum <guido@python.org> | 1997-02-14 22:59:58 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-02-14 22:59:58 (GMT) |
commit | 52fa3a69090ac098b01b28f397d9bd08f957e8cd (patch) | |
tree | c01e3347c776bd8f5deb93af7e90cfca37dea8eb /Modules/mathmodule.c | |
parent | 0ae748d3c409fc4b870baadd601a53c6a43ddf11 (diff) | |
download | cpython-52fa3a69090ac098b01b28f397d9bd08f957e8cd.zip cpython-52fa3a69090ac098b01b28f397d9bd08f957e8cd.tar.gz cpython-52fa3a69090ac098b01b28f397d9bd08f957e8cd.tar.bz2 |
Changes for Lee Busby's SIGFPE patch set.
Two new modules fpectl and fpetest.
Surround various and sundry f.p. operations with PyFPE_*_PROTECT macros.
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index abf1d5b..bb4f1e8 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -80,7 +80,9 @@ math_1(args, func) if (! PyArg_Parse(args, "d", &x)) return NULL; errno = 0; + PyFPE_START_PROTECT("in math_1", return 0) x = (*func)(x); + PyFPE_END_PROTECT CHECK(x); if (errno != 0) return math_error(); @@ -97,7 +99,9 @@ math_2(args, func) if (! PyArg_Parse(args, "(dd)", &x, &y)) return NULL; errno = 0; + PyFPE_START_PROTECT("in math_2", return 0) x = (*func)(x, y); + PyFPE_END_PROTECT CHECK(x); if (errno != 0) return math_error(); @@ -173,7 +177,9 @@ math_ldexp(self, args) if (! PyArg_Parse(args, "(dd)", &x, &y)) return NULL; errno = 0; + PyFPE_START_PROTECT("ldexp", return 0) x = ldexp(x, (int)y); + PyFPE_END_PROTECT CHECK(x); if (errno != 0) return math_error(); |