summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index e134691..ee18bc3 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -655,7 +655,7 @@ _Py_HashDouble(double v)
fractpart = modf(v, &intpart);
if (fractpart == 0.0) {
/* This must return the same hash as an equal int or long. */
- if (intpart > LONG_MAX || -intpart > LONG_MAX) {
+ if (intpart > LONG_MAX/2 || -intpart > LONG_MAX/2) {
/* Convert to long and use its hash. */
PyObject *plong; /* converted to Python long */
if (Py_IS_INFINITY(intpart))