X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fatan.c;h=63b0ab25e3cf02ea81bab5a9ee4d99d6c40bb582;hb=06d4075a50b84d4b80e09eb5662fc1153bd559f7;hp=7fd8a3b8a1a35f22a7b61345f20ffb32beea8cdd;hpb=969ddbc423238291d5c7982790bbe72720627ba4;p=musl diff --git a/src/math/atan.c b/src/math/atan.c index 7fd8a3b8..63b0ab25 100644 --- a/src/math/atan.c +++ b/src/math/atan.c @@ -62,7 +62,7 @@ static const double aT[] = { double atan(double x) { - double w,s1,s2,z; + double_t w,s1,s2,z; uint32_t ix,sign; int id; @@ -72,13 +72,14 @@ double atan(double x) if (ix >= 0x44100000) { /* if |x| >= 2^66 */ if (isnan(x)) return x; - z = atanhi[3] + 0x1p-1000; + z = atanhi[3] + 0x1p-120f; return sign ? -z : z; } if (ix < 0x3fdc0000) { /* |x| < 0.4375 */ if (ix < 0x3e400000) { /* |x| < 2^-27 */ - /* raise inexact if x!=0 */ - FORCE_EVAL(x + 0x1p1000); + if (ix < 0x00100000) + /* raise underflow for subnormal x */ + FORCE_EVAL((float)x); return x; } id = -1;