X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsinl.c;h=2c9068f619ea9cb5f663066d9d26a5d2528848b6;hb=dd6ceef65e424d30db8706273f88c20b015012ce;hp=02c70354f5467e290f065d5c2cf4063d643a17b4;hpb=e1123c2f4fedae90435426a82a05cf2e3233e97d;p=gnulib.git diff --git a/lib/sinl.c b/lib/sinl.c index 02c70354f..2c9068f61 100644 --- a/lib/sinl.c +++ b/lib/sinl.c @@ -52,6 +52,7 @@ #include "trigl.h" #include "trigl.c" #include "sincosl.c" +#include "isnanl.h" long double sinl (long double x) @@ -59,13 +60,17 @@ sinl (long double x) long double y[2], z = 0.0L; int n; + /* sinl(NaN) is NaN */ + if (isnanl (x)) + return x; + /* |x| ~< pi/4 */ if (x >= -0.7853981633974483096156608458198757210492 && x <= 0.7853981633974483096156608458198757210492) return kernel_sinl (x, z, 0); - /* sinl(Inf or NaN) is NaN, sinl(0) is 0 */ - else if (x + x == x || x != x) + /* sinl(Inf) is NaN, sinl(0) is 0 */ + else if (x + x == x) return x - x; /* NaN */ /* argument reduction needed */