mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Issue #4575: fix Py_IS_INFINITY macro to work correctly on x87 FPUs.
It now forces its argument to double before testing for infinity.
This commit is contained in:
parent
b20af944d2
commit
c97c9096ed
3 changed files with 40 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue