Skip to content

Commit 272c538

Browse files
committed
+ cast
1 parent 7776661 commit 272c538

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Objects/floatobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,14 +1929,14 @@ PyFloat_Pack2(double x, char *data, int le)
19291929
* canonical NaN of the new type". The canonical NaN here
19301930
* is a positive qNaN with zero payload. */
19311931
if (v & (1ULL << 63)) {
1932-
u16 |= (1U << 15); /* set sign */
1932+
u16 |= (uint16_t)(1U << 15); /* set sign */
19331933
}
19341934
/* add payload */
19351935
u16 -= (u16 & 0x1ff);
19361936
u16 += (uint16_t)((v & 0x7ffffffffffffULL) >> 42);
19371937
/* if have payload, make sNaN */
19381938
if ((v & (1ULL << 51)) == 0 && (u16 & 0x1ff)) {
1939-
u16 &= ~(1 << 9);
1939+
u16 &= ~(uint16_t)(1 << 9);
19401940
}
19411941

19421942
memcpy(&y, &u16, 2);

0 commit comments

Comments
 (0)