about summary refs log tree commit diff
path: root/src/math/fmal.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2013-05-19 14:43:32 +0000
committerSzabolcs Nagy <nsz@port70.net>2013-05-19 14:43:32 +0000
commit1e5eb73545ca6cfe8b918798835aaf6e07af5beb (patch)
treed1af43fb6a86387586e5fbdcede7d2a3f56c78d4 /src/math/fmal.c
parentffd8ac2dd50f99c3c83d7d9d845df9874ec3e7d5 (diff)
downloadmusl-1e5eb73545ca6cfe8b918798835aaf6e07af5beb.tar.gz
musl-1e5eb73545ca6cfe8b918798835aaf6e07af5beb.tar.xz
musl-1e5eb73545ca6cfe8b918798835aaf6e07af5beb.zip
math: add fma TODO comments about the underflow issue
The underflow exception is not raised correctly in some
cornercases (see previous fma commit), added comments
with examples for fmaf, fmal and non-x86 fma.

In fmaf store the result before returning so it has the
correct precision when FLT_EVAL_METHOD!=0
Diffstat (limited to 'src/math/fmal.c')
-rw-r--r--src/math/fmal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/math/fmal.c b/src/math/fmal.c
index ccbe434d..87e30fcf 100644
--- a/src/math/fmal.c
+++ b/src/math/fmal.c
@@ -262,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;