Skip to content

Commit b7f727c

Browse files
skirpichevvstinner
andauthored
Apply suggestions from code review
Co-authored-by: Victor Stinner <[email protected]>
1 parent 00dfd66 commit b7f727c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Modules/_testcapi/float.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ _testcapi_float_set_snan(PyObject *module, PyObject *obj)
181181
}
182182
uint64_t v;
183183
memcpy(&v, &d, 8);
184-
v &= ~(1ULL<<51); /* make sNaN */
184+
v &= ~(1ULL << 51); /* make sNaN */
185185
memcpy(&d, &v, 8);
186186
return PyFloat_FromDouble(d);
187187
}

Objects/floatobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,6 @@ PyFloat_Pack2(double x, char *data, int le)
20252025
e = 0x1f;
20262026

20272027
uint64_t v;
2028-
20292028
memcpy(&v, &x, sizeof(v));
20302029
v &= 0xffc0000000000ULL;
20312030
bits = (unsigned short)(v >> 42); /* NaN's type & payload */
@@ -2489,8 +2488,8 @@ PyFloat_Unpack4(const char *data, int le)
24892488
/* return sNaN double if x was sNaN float */
24902489
if (isnan(x)) {
24912490
uint32_t v;
2492-
24932491
memcpy(&v, &x, 4);
2492+
24942493
if ((v & (1 << 22)) == 0) {
24952494
double y = x; /* will make qNaN double */
24962495
uint64_t *py = (uint64_t *)&y;

0 commit comments

Comments
 (0)