Skip to content

Commit 4d654aa

Browse files
committed
extend fix to RISC-V
1 parent 105cb1a commit 4d654aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/floatobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ PyFloat_Pack4(double x, char *data, int le)
22162216
uint32_t u32;
22172217

22182218
memcpy(&u32, &y, 4);
2219-
if ((v & (1ULL << 51)) == 0) {
2219+
if ((v & (1ULL << 51)) == 0 && (u32 & 0x3fffff)) {
22202220
u32 &= ~(1 << 22);
22212221
}
22222222
/* Workaround RISC-V: "If a NaN value is converted to a

0 commit comments

Comments
 (0)