diff options
author | Jakob Kaivo <jkk@ung.org> | 2024-01-30 13:24:56 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2024-01-30 13:24:56 -0500 |
commit | 371913c93cc3ffc4dd0a4a18bc0f3021f0ec05db (patch) | |
tree | cfed8177dfedcb340b89475c0541c0ab74127abd | |
parent | 548a71c010f8adf2d71f56436c67136ad6e0f316 (diff) |
update standard and safety checks
73 files changed, 69 insertions, 1 deletions
diff --git a/src/math/__fpclassify.c b/src/math/__fpclassify.c index 48933db8..21cbba71 100644 --- a/src/math/__fpclassify.c +++ b/src/math/__fpclassify.c @@ -6,11 +6,13 @@ int TGFN(__fpclassify)(TYPE x) { + SIGNAL_SAFE(0); (void)x; return FP_NORMAL; } /* +STDC(0) LINK(m) */ diff --git a/src/math/acos.c b/src/math/acos.c index 8c934d0e..ac382bfa 100644 --- a/src/math/acos.c +++ b/src/math/acos.c @@ -9,6 +9,7 @@ TYPE TGFN(acos)(TYPE x) { + SIGNAL_SAFE(0); if (TGFN(fabs)(x) > 1) { feraiseexcept(FE_INVALID); return NAN; diff --git a/src/math/acosh.c b/src/math/acosh.c index 5bc18422..1f4a58bb 100644 --- a/src/math/acosh.c +++ b/src/math/acosh.c @@ -7,6 +7,7 @@ TYPE TGFN(acosh)(TYPE x) { + SIGNAL_SAFE(0); if (x == 1.0) { return 0.0; } diff --git a/src/math/asin.c b/src/math/asin.c index fc42f7f8..a7372e0e 100644 --- a/src/math/asin.c +++ b/src/math/asin.c @@ -9,6 +9,7 @@ TYPE TGFN(asin)(TYPE x) { + SIGNAL_SAFE(0); if (TGFN(fabs)(x) > 1.0) { errno = EDOM; /* ARGUMENT(x) is not in the range [-1, +1] */ return TGHUGE; diff --git a/src/math/asinh.c b/src/math/asinh.c index c2e6b640..290f7946 100644 --- a/src/math/asinh.c +++ b/src/math/asinh.c @@ -6,6 +6,7 @@ TYPE TGFN(asinh)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/atan.c b/src/math/atan.c index 0bf07ec7..1a6f5aa4 100644 --- a/src/math/atan.c +++ b/src/math/atan.c @@ -9,6 +9,7 @@ TYPE TGFN(atan)(TYPE x) { + SIGNAL_SAFE(0); int MAXLOOPS = 10; TYPE arctan = 0.0; TYPE power = 1.0; diff --git a/src/math/atan2.c b/src/math/atan2.c index d81b417e..f7cc8ebd 100644 --- a/src/math/atan2.c +++ b/src/math/atan2.c @@ -3,13 +3,14 @@ # define TGSOURCE "atan2.c" #include <errno.h> #include <math.h> -#include "_assert.h" +#include "_safety.h" #include "_tgmath.h" /** arc tangent **/ TYPE TGFN(atan2)(TYPE y, TYPE x) { + SIGNAL_SAFE(0); int classy = fpclassify(y); int classx = fpclassify(x); ASSERT_NONZERO(x); diff --git a/src/math/atanh.c b/src/math/atanh.c index 97cb2b3b..af2b107c 100644 --- a/src/math/atanh.c +++ b/src/math/atanh.c @@ -7,6 +7,7 @@ TYPE TGFN(atanh)(TYPE x) { + SIGNAL_SAFE(0); if (fpclassify(x) == FP_ZERO) { return x; } diff --git a/src/math/cbrt.c b/src/math/cbrt.c index 4e924db2..e15af42c 100644 --- a/src/math/cbrt.c +++ b/src/math/cbrt.c @@ -6,6 +6,7 @@ TYPE TGFN(cbrt)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/ceil.c b/src/math/ceil.c index 291ecf18..35f6a099 100644 --- a/src/math/ceil.c +++ b/src/math/ceil.c @@ -9,6 +9,7 @@ TYPE TGFN(ceil)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/copysign.c b/src/math/copysign.c index 6a9fe9a3..21ad6701 100644 --- a/src/math/copysign.c +++ b/src/math/copysign.c @@ -8,6 +8,7 @@ TYPE TGFN(copysign)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); if (isnan(x)) { if (signbit(y)) { /* return -NaN; */ diff --git a/src/math/cos.c b/src/math/cos.c index fec3824a..31fdcfcb 100644 --- a/src/math/cos.c +++ b/src/math/cos.c @@ -9,6 +9,7 @@ TYPE TGFN(cos)(TYPE x) { + SIGNAL_SAFE(0); int MAXLOOPS = 10; int factorial = 1; int i; diff --git a/src/math/cosh.c b/src/math/cosh.c index 66c20bf2..8ec63aa8 100644 --- a/src/math/cosh.c +++ b/src/math/cosh.c @@ -9,6 +9,7 @@ TYPE TGFN(cosh)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return 1.0; case FP_INFINITE: return TGFN(fabs)(x); diff --git a/src/math/erf.c b/src/math/erf.c index db5488e1..29fb392b 100644 --- a/src/math/erf.c +++ b/src/math/erf.c @@ -6,6 +6,7 @@ TYPE TGFN(erf)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return signbit(x) ? -1.0 : 1.0; diff --git a/src/math/erfc.c b/src/math/erfc.c index 7242e9de..20791e4d 100644 --- a/src/math/erfc.c +++ b/src/math/erfc.c @@ -6,6 +6,7 @@ TYPE TGFN(erfc)(TYPE x) { + SIGNAL_SAFE(0); if (fpclassify(x) == FP_INFINITE) { return signbit(x) ? 2.0 : 0.0; } diff --git a/src/math/exp.c b/src/math/exp.c index 0d6b40b8..54bc6018 100644 --- a/src/math/exp.c +++ b/src/math/exp.c @@ -9,6 +9,7 @@ TYPE TGFN(exp)(TYPE x) { + SIGNAL_SAFE(0); int MAXLOOPS = 10; int i; int factorial = 1; diff --git a/src/math/exp2.c b/src/math/exp2.c index 5e8e17b2..2e2fbb90 100644 --- a/src/math/exp2.c +++ b/src/math/exp2.c @@ -6,6 +6,7 @@ TYPE TGFN(exp2)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return 1.0; case FP_INFINITE: return signbit(x) ? 0.0 : x; diff --git a/src/math/expm1.c b/src/math/expm1.c index 0fdee6fe..bee08865 100644 --- a/src/math/expm1.c +++ b/src/math/expm1.c @@ -6,6 +6,7 @@ TYPE TGFN(expm1)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return signbit(x) ? -1.0 : x; diff --git a/src/math/fabs.c b/src/math/fabs.c index b156d478..7fb29369 100644 --- a/src/math/fabs.c +++ b/src/math/fabs.c @@ -9,6 +9,7 @@ TYPE TGFN(fabs)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return 0.0; case FP_INFINITE: return INFINITY; diff --git a/src/math/fdim.c b/src/math/fdim.c index 289f5378..e4f4049d 100644 --- a/src/math/fdim.c +++ b/src/math/fdim.c @@ -6,6 +6,7 @@ TYPE TGFN(fdim)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); if (x > y) { return x - y; } diff --git a/src/math/floor.c b/src/math/floor.c index d759c9c3..46308d59 100644 --- a/src/math/floor.c +++ b/src/math/floor.c @@ -9,6 +9,7 @@ TYPE TGFN(floor)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/fma.c b/src/math/fma.c index d36aa408..766dd176 100644 --- a/src/math/fma.c +++ b/src/math/fma.c @@ -7,6 +7,7 @@ TYPE TGFN(fma)(TYPE x, TYPE y, TYPE z) { + SIGNAL_SAFE(0); int classx = fpclassify(x); int classy = fpclassify(y); /* int classz = fpclassify(z); */ diff --git a/src/math/fmax.c b/src/math/fmax.c index e4bf1d11..a3d7228f 100644 --- a/src/math/fmax.c +++ b/src/math/fmax.c @@ -6,6 +6,7 @@ TYPE TGFN(fmax)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); if (isnan(x) && !isnan(y)) { return y; } else if (!isnan(x) && isnan(y)) { diff --git a/src/math/fmin.c b/src/math/fmin.c index d1427ad7..05efaf5d 100644 --- a/src/math/fmin.c +++ b/src/math/fmin.c @@ -6,6 +6,7 @@ TYPE TGFN(fmin)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); if (isnan(x) && !isnan(y)) { return y; } else if (!isnan(x) && isnan(y)) { diff --git a/src/math/fmod.c b/src/math/fmod.c index 68474424..102e48dc 100644 --- a/src/math/fmod.c +++ b/src/math/fmod.c @@ -9,6 +9,7 @@ TYPE TGFN(fmod)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); int classx = fpclassify(x); int classy = fpclassify(y); diff --git a/src/math/frexp.c b/src/math/frexp.c index e60a5e04..52d0c413 100644 --- a/src/math/frexp.c +++ b/src/math/frexp.c @@ -9,6 +9,7 @@ TYPE TGFN(frexp)(TYPE value, int *exp) { + SIGNAL_SAFE(0); switch (fpclassify(value)) { case FP_ZERO: *exp = 0; return value; case FP_INFINITE: *exp = /* unspecified */0; return value; diff --git a/src/math/gamma.c b/src/math/gamma.c index d26da45b..524eb70d 100644 --- a/src/math/gamma.c +++ b/src/math/gamma.c @@ -4,6 +4,7 @@ double gamma(double x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/hypot.c b/src/math/hypot.c index 60f68384..9dbed0c0 100644 --- a/src/math/hypot.c +++ b/src/math/hypot.c @@ -6,6 +6,7 @@ TYPE TGFN(hypot)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); if (fpclassify(y) == FP_ZERO) { return fabs(x); } diff --git a/src/math/ilogb.c b/src/math/ilogb.c index 8c24aecb..d93b6602 100644 --- a/src/math/ilogb.c +++ b/src/math/ilogb.c @@ -8,6 +8,7 @@ int TGFN(ilogb)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: feraiseexcept(FE_INVALID); return FP_ILOGB0; case FP_INFINITE: feraiseexcept(FE_INVALID); return INT_MAX; diff --git a/src/math/isgreater.c b/src/math/isgreater.h index b778c1dd..b778c1dd 100644 --- a/src/math/isgreater.c +++ b/src/math/isgreater.h diff --git a/src/math/isgreaterequal.c b/src/math/isgreaterequal.h index 0c9cdc03..0c9cdc03 100644 --- a/src/math/isgreaterequal.c +++ b/src/math/isgreaterequal.h diff --git a/src/math/isless.c b/src/math/isless.h index 673afce7..673afce7 100644 --- a/src/math/isless.c +++ b/src/math/isless.h diff --git a/src/math/islessequal.c b/src/math/islessequal.h index 3f300c4a..3f300c4a 100644 --- a/src/math/islessequal.c +++ b/src/math/islessequal.h diff --git a/src/math/islessgreater.c b/src/math/islessgreater.h index ea0d056c..ea0d056c 100644 --- a/src/math/islessgreater.c +++ b/src/math/islessgreater.h diff --git a/src/math/isunordered.c b/src/math/isunordered.h index 0cdf50bc..0cdf50bc 100644 --- a/src/math/isunordered.c +++ b/src/math/isunordered.h diff --git a/src/math/j0.c b/src/math/j0.c index f41f18b6..b57c36a8 100644 --- a/src/math/j0.c +++ b/src/math/j0.c @@ -4,6 +4,7 @@ double j0(double x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/j1.c b/src/math/j1.c index b414e63c..2f0473e0 100644 --- a/src/math/j1.c +++ b/src/math/j1.c @@ -4,6 +4,7 @@ double j1(double x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/jn.c b/src/math/jn.c index b151f02b..02cce558 100644 --- a/src/math/jn.c +++ b/src/math/jn.c @@ -4,6 +4,7 @@ double jn(int n, double x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/ldexp.c b/src/math/ldexp.c index f5605cdb..ad2f5a94 100644 --- a/src/math/ldexp.c +++ b/src/math/ldexp.c @@ -9,6 +9,7 @@ TYPE TGFN(ldexp)(TYPE x, int exp) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/lgamma.c b/src/math/lgamma.c index df2367ae..132d1478 100644 --- a/src/math/lgamma.c +++ b/src/math/lgamma.c @@ -7,6 +7,7 @@ TYPE TGFN(lgamma)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: feraiseexcept(FE_DIVBYZERO); return INFINITY; case FP_INFINITE: return INFINITY; diff --git a/src/math/llrint.c b/src/math/llrint.c index 168ef5df..c6b2b7b7 100644 --- a/src/math/llrint.c +++ b/src/math/llrint.c @@ -8,6 +8,7 @@ long long int TGFN(llrint)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return 0; diff --git a/src/math/llround.c b/src/math/llround.c index 589ad2c8..1402abdf 100644 --- a/src/math/llround.c +++ b/src/math/llround.c @@ -6,6 +6,7 @@ long long int TGFN(llround)(TYPE x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/log.c b/src/math/log.c index 8ec97e17..e1914dd0 100644 --- a/src/math/log.c +++ b/src/math/log.c @@ -9,6 +9,7 @@ TYPE TGFN(log)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: feraiseexcept(FE_DIVBYZERO); return - INFINITY; case FP_INFINITE: if (!signbit(x)) { return x; } diff --git a/src/math/log10.c b/src/math/log10.c index 90f10b64..f0ad9300 100644 --- a/src/math/log10.c +++ b/src/math/log10.c @@ -9,6 +9,7 @@ TYPE TGFN(log10)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: feraiseexcept(FE_INVALID); return - INFINITY; case FP_INFINITE: if (!signbit(x)) { return x; } break; diff --git a/src/math/log1p.c b/src/math/log1p.c index 5de637b7..4163a184 100644 --- a/src/math/log1p.c +++ b/src/math/log1p.c @@ -7,6 +7,7 @@ TYPE TGFN(log1p)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: if (!signbit(x)) { return x; } break; diff --git a/src/math/log2.c b/src/math/log2.c index c339d3df..a39f6017 100644 --- a/src/math/log2.c +++ b/src/math/log2.c @@ -7,6 +7,7 @@ TYPE TGFN(log2)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: feraiseexcept(FE_DIVBYZERO); return - INFINITY; case FP_INFINITE: if (!signbit(x)) { return x; } break; diff --git a/src/math/logb.c b/src/math/logb.c index eb939211..284705c4 100644 --- a/src/math/logb.c +++ b/src/math/logb.c @@ -7,6 +7,7 @@ TYPE TGFN(logb)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: feraiseexcept(FE_DIVBYZERO); return - INFINITY; case FP_INFINITE: return x; diff --git a/src/math/lrint.c b/src/math/lrint.c index f760c04e..6398bbcd 100644 --- a/src/math/lrint.c +++ b/src/math/lrint.c @@ -8,6 +8,7 @@ long int TGFN(lrint)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return 0; diff --git a/src/math/lround.c b/src/math/lround.c index c690679b..8cbd9275 100644 --- a/src/math/lround.c +++ b/src/math/lround.c @@ -6,6 +6,7 @@ long int TGFN(lround)(TYPE x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/modf.c b/src/math/modf.c index c39ba054..59ad3e19 100644 --- a/src/math/modf.c +++ b/src/math/modf.c @@ -9,6 +9,7 @@ TYPE TGFN(modf)(TYPE value, TYPE *iptr) { + SIGNAL_SAFE(0); switch (fpclassify(value)) { case FP_INFINITE: *iptr = value; return copysign(0.0, value); case FP_NAN: *iptr = value; return value; diff --git a/src/math/nan.c b/src/math/nan.c index d56c268f..5577a693 100644 --- a/src/math/nan.c +++ b/src/math/nan.c @@ -11,6 +11,7 @@ TYPE TGFN(nan)(const char *tagp) { + SIGNAL_SAFE(0); if (tagp) { char ncharseq[strlen(tagp) + 6]; strcpy(ncharseq, "NAN("); diff --git a/src/math/nearbyint.c b/src/math/nearbyint.c index 29a7a2c2..a4caac5e 100644 --- a/src/math/nearbyint.c +++ b/src/math/nearbyint.c @@ -6,6 +6,7 @@ TYPE TGFN(nearbyint)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/nextafter.c b/src/math/nextafter.c index 16a8bcb0..7e6cd87a 100644 --- a/src/math/nextafter.c +++ b/src/math/nextafter.c @@ -6,6 +6,7 @@ TYPE TGFN(nextafter)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); return x - y; } diff --git a/src/math/nexttoward.c b/src/math/nexttoward.c index 3ca38bfd..148bf95d 100644 --- a/src/math/nexttoward.c +++ b/src/math/nexttoward.c @@ -6,6 +6,7 @@ TYPE TGFN(nexttoward)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); return x - y; } diff --git a/src/math/pow.c b/src/math/pow.c index e5e927c9..8d5d4a50 100644 --- a/src/math/pow.c +++ b/src/math/pow.c @@ -9,6 +9,7 @@ TYPE TGFN(pow)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); int classx = fpclassify(x); int classy = fpclassify(y); diff --git a/src/math/remainder.c b/src/math/remainder.c index 1f8942d0..c62e3d2c 100644 --- a/src/math/remainder.c +++ b/src/math/remainder.c @@ -6,6 +6,7 @@ TYPE TGFN(remainder)(TYPE x, TYPE y) { + SIGNAL_SAFE(0); } /* diff --git a/src/math/remquo.c b/src/math/remquo.c index 1a1d852c..7c3eadfe 100644 --- a/src/math/remquo.c +++ b/src/math/remquo.c @@ -6,6 +6,7 @@ TYPE TGFN(remquo)(TYPE x, TYPE y, int *quo) { + SIGNAL_SAFE(0); (void)quo; return x - y; } diff --git a/src/math/rint.c b/src/math/rint.c index c594897c..b532e309 100644 --- a/src/math/rint.c +++ b/src/math/rint.c @@ -6,6 +6,7 @@ TYPE TGFN(rint)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/round.c b/src/math/round.c index 8801a032..3534f734 100644 --- a/src/math/round.c +++ b/src/math/round.c @@ -11,6 +11,7 @@ TYPE TGFN(round)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/scalb.c b/src/math/scalb.c index 5a884a14..b15dd9a1 100644 --- a/src/math/scalb.c +++ b/src/math/scalb.c @@ -4,6 +4,7 @@ double scalb(double x, double n) { + SIGNAL_SAFE(0); } /* diff --git a/src/math/scalbln.c b/src/math/scalbln.c index ae2dac19..64495adb 100644 --- a/src/math/scalbln.c +++ b/src/math/scalbln.c @@ -6,6 +6,7 @@ TYPE TGFN(scalbln)(TYPE x, long int n) { + SIGNAL_SAFE(0); return x - n; } diff --git a/src/math/scalbn.c b/src/math/scalbn.c index 520fe495..3d31349b 100644 --- a/src/math/scalbn.c +++ b/src/math/scalbn.c @@ -6,6 +6,7 @@ TYPE TGFN(scalbn)(TYPE x, int n) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/signgam.c b/src/math/signgam.c index 919f3adf..9b49044f 100644 --- a/src/math/signgam.c +++ b/src/math/signgam.c @@ -3,6 +3,7 @@ #include <math.h> int signgam; /* +SIGNAL_SAFE(0) XOPEN(4) LINK(m) */ diff --git a/src/math/sin.c b/src/math/sin.c index effec5e1..ac3ece16 100644 --- a/src/math/sin.c +++ b/src/math/sin.c @@ -9,6 +9,7 @@ TYPE TGFN(sin)(TYPE x) { + SIGNAL_SAFE(0); int MAXLOOPS = 10; int factorial = 1; int i; diff --git a/src/math/sinh.c b/src/math/sinh.c index aa2b1ca6..ff878d64 100644 --- a/src/math/sinh.c +++ b/src/math/sinh.c @@ -9,6 +9,7 @@ TYPE TGFN(sinh)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/sqrt.c b/src/math/sqrt.c index 62346e16..b16b33c2 100644 --- a/src/math/sqrt.c +++ b/src/math/sqrt.c @@ -9,6 +9,7 @@ TYPE TGFN(sqrt)(TYPE x) { + SIGNAL_SAFE(0); if (x < 0) { errno = EDOM; /* ARGUMENT(x) is negative */ return TGHUGE; diff --git a/src/math/tan.c b/src/math/tan.c index dc12e98a..6565ac57 100644 --- a/src/math/tan.c +++ b/src/math/tan.c @@ -9,6 +9,7 @@ TYPE TGFN(tan)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: feraiseexcept(FE_INVALID); return NAN; diff --git a/src/math/tanh.c b/src/math/tanh.c index 7a00c59c..7d4bd3e3 100644 --- a/src/math/tanh.c +++ b/src/math/tanh.c @@ -9,6 +9,7 @@ TYPE TGFN(tanh)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return signbit(x) ? -1.0 : 1.0; diff --git a/src/math/tgamma.c b/src/math/tgamma.c index af5f38f4..390b0c9a 100644 --- a/src/math/tgamma.c +++ b/src/math/tgamma.c @@ -7,6 +7,7 @@ TYPE TGFN(tgamma)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: feraiseexcept(FE_DIVBYZERO); diff --git a/src/math/trunc.c b/src/math/trunc.c index fa2a9c5d..f8506872 100644 --- a/src/math/trunc.c +++ b/src/math/trunc.c @@ -6,6 +6,7 @@ TYPE TGFN(trunc)(TYPE x) { + SIGNAL_SAFE(0); switch (fpclassify(x)) { case FP_ZERO: return x; case FP_INFINITE: return x; diff --git a/src/math/y0.c b/src/math/y0.c index ad85af18..c1608729 100644 --- a/src/math/y0.c +++ b/src/math/y0.c @@ -4,6 +4,7 @@ double y0(double x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/y1.c b/src/math/y1.c index 9fefc2b5..a33a0995 100644 --- a/src/math/y1.c +++ b/src/math/y1.c @@ -4,6 +4,7 @@ double y1(double x) { + SIGNAL_SAFE(0); return x; } diff --git a/src/math/yn.c b/src/math/yn.c index 2a39b015..54460859 100644 --- a/src/math/yn.c +++ b/src/math/yn.c @@ -4,6 +4,7 @@ double yn(int n, double x) { + SIGNAL_SAFE(0); return x; } |