X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmath%2Fexpf.c;h=f706ac5da9346740804bc2f81e5db7963a9f3821;hp=a0eaa7a7ea15af737351b4c8d372f48f8a6c44ec;hb=b935147761d1770bb115f09f8c28ddb4d36e1236;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd diff --git a/src/math/expf.c b/src/math/expf.c index a0eaa7a7..f706ac5d 100644 --- a/src/math/expf.c +++ b/src/math/expf.c @@ -33,7 +33,7 @@ invln2 = 1.4426950216e+00, /* 0x3fb8aa3b */ P1 = 1.6666625440e-1, /* 0xaaaa8f.0p-26 */ P2 = -2.7667332906e-3; /* -0xb55215.0p-32 */ -static volatile float twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ +static const volatile float twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ float expf(float x) { @@ -85,11 +85,11 @@ float expf(float x) SET_FLOAT_WORD(twopk, 0x3f800000+((k+100)<<23)); c = x - t*(P1+t*P2); if (k == 0) - return one - ((x*c)/(c-(float)2.0)-x); - y = one - ((lo-(x*c)/((float)2.0-c))-hi); + return one - ((x*c)/(c - 2.0f) - x); + y = one - ((lo - (x*c)/(2.0f - c)) - hi); if (k < -125) return y*twopk*twom100; if (k == 128) - return y*2.0F*0x1p127F; + return y*2.0f*0x1p127f; return y*twopk; }