summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/floatobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index fc1ddf4..8d7a55a 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -2233,13 +2233,13 @@ _PyFloat_Pack4(double x, unsigned char *p, int le)
}
else {
+ float y = (float)x;
int i, incr = 1;
- if (fabs(x) > FLT_MAX && !Py_IS_INFINITY(x))
+ if (Py_IS_INFINITY(y) && !Py_IS_INFINITY(x))
goto Overflow;
unsigned char s[sizeof(float)];
- float y = (float)x;
memcpy(s, &y, sizeof(float));
if ((float_format == ieee_little_endian_format && !le)