2011-03-15  Kai Tietz  <ktietz70@googlemail.com>

        * math/exp.def.h: Use integer/fraction separation for improving
        calculation precision.



git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@4078 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-crt/ChangeLog b/mingw-w64-crt/ChangeLog
index eb74976..f2fc0d8 100644
--- a/mingw-w64-crt/ChangeLog
+++ b/mingw-w64-crt/ChangeLog
@@ -1,5 +1,7 @@
 2011-03-15  Kai Tietz  <ktietz70@googlemail.com>
 
+	* math/exp.def.h: Use integer/fraction separation for improving
+	calculation precision.
 	* math/pow.def.h: Use log2l/exp2l and integer/fraction separation
 	for improving calculation precission.
 
diff --git a/mingw-w64-crt/math/exp.def.h b/mingw-w64-crt/math/exp.def.h
index 4650fd7..ae1f188 100644
--- a/mingw-w64-crt/math/exp.def.h
+++ b/mingw-w64-crt/math/exp.def.h
@@ -110,5 +110,9 @@
       return __FLT_CST(0.0);
     }
   else
-    return (__FLT_TYPE) __expl_internal ((long double) x);
+    {
+      long double fr, in;
+      in = modfl ((long double) x, &fr);
+      return (__FLT_TYPE) (__expl_internal (fr) * __expl_internal (in));
+    }
 }