X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Ffmal.c;h=87e30fcf65394f71b34027081feb9cab0f013ca4;hb=01739902843e93ec6e9bf8e17d32c8ddf73fad81;hp=be64f145bbaeee42d5f29b63ce87f31251c15942;hpb=634c3a63027aa4a693b64fae0e2f6e1635558e93;p=musl diff --git a/src/math/fmal.c b/src/math/fmal.c index be64f145..87e30fcf 100644 --- a/src/math/fmal.c +++ b/src/math/fmal.c @@ -162,6 +162,7 @@ static inline struct dd dd_mul(long double a, long double b) */ long double fmal(long double x, long double y, long double z) { + #pragma STDC FENV_ACCESS ON long double xs, ys, zs, adj; struct dd xy, r; int oround; @@ -261,6 +262,8 @@ long double fmal(long double x, long double y, long double z) /* * There is no need to worry about double rounding in directed * rounding modes. + * TODO: underflow is not raised correctly, example in downward rounding: + * fmal(0x1.0000000001p-16000L, 0x1.0000000001p-400L, -0x1p-16440L) */ fesetround(oround); adj = r.lo + xy.lo;