Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43f04a3

Browse files
committed
The tail end of x_sub implicitly assumed that an unsigned short
contains 16 bits. Not true on Cray J90.
1 parent a90b23c commit 43f04a3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Objects/longobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ x_sub(PyLongObject *a, PyLongObject *b)
10481048
borrow = a->ob_digit[i] - borrow;
10491049
z->ob_digit[i] = borrow & MASK;
10501050
borrow >>= SHIFT;
1051+
borrow &= 1; /* Keep only one sign bit */
10511052
}
10521053
assert(borrow == 0);
10531054
if (sign < 0)

0 commit comments

Comments
 (0)