summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-05-04 13:30:43 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-05-04 13:30:43 (GMT)
commite05e8409e1b47a2c018ad8a67016546217165c60 (patch)
treec9c456bdf14ee3d9c0821ee2ee843a45bcf9bdf9 /Python
parent67032252588e3919e4fbfbbd256b91add8a5af45 (diff)
downloadcpython-e05e8409e1b47a2c018ad8a67016546217165c60.zip
cpython-e05e8409e1b47a2c018ad8a67016546217165c60.tar.gz
cpython-e05e8409e1b47a2c018ad8a67016546217165c60.tar.bz2
Issue #5724: Fix cmath failures on Solaris 10.
Diffstat (limited to 'Python')
-rw-r--r--Python/pymath.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/pymath.c b/Python/pymath.c
index 6b8def9..2749688 100644
--- a/Python/pymath.c
+++ b/Python/pymath.c
@@ -1,5 +1,18 @@
#include "Python.h"
+#ifdef X87_DOUBLE_ROUNDING
+/* On x86 platforms using an x87 FPU, this function is called from the
+ Py_FORCE_DOUBLE macro (defined in pymath.h) to force a floating-point
+ number out of an 80-bit x87 FPU register and into a 64-bit memory location,
+ thus rounding from extended precision to double precision. */
+double _Py_force_double(double x)
+{
+ volatile double y;
+ y = x;
+ return y;
+}
+#endif
+
#ifndef HAVE_HYPOT
double hypot(double x, double y)
{