Skip to content

Commit 85b0325

Browse files
committed
Minor cleanups.
1 parent 025a1f8 commit 85b0325

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/quicktions.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ cpdef _gcd(a, b):
164164
return _c_gcd(PyLong_CompactValueUnsigned(a), PyLong_CompactValueUnsigned(b))
165165
if PY_VERSION_HEX >= 0x030d0000:
166166
return math_gcd(a, b)
167-
if PY_VERSION_HEX < 0x030500F0 or not HAS_PYLONG_GCD:
167+
if not HAS_PYLONG_GCD:
168168
return _gcd_fallback(a, b)
169169
return _PyLong_GCD(a, b)
170170

@@ -2032,7 +2032,7 @@ cdef tuple _parse_fraction(AnyString s, Py_ssize_t s_len, orig_str):
20322032
if pos < s_len :
20332033
_raise_invalid_input(orig_str)
20342034

2035-
is_normalised = False
2035+
cdef bint is_normalised = False
20362036
if state in (SMALL_NUM, SMALL_DECIMAL, SMALL_DECIMAL_DOT, SMALL_END_SPACE):
20372037
# Special case for 'small' numbers: normalise directly in C space.
20382038
if inum and decimal_len:
@@ -2079,7 +2079,7 @@ cdef tuple _parse_fraction(AnyString s, Py_ssize_t s_len, orig_str):
20792079
num *= pow10(iexp)
20802080
elif iexp < 0:
20812081
# Only need to normalise if the numerator contains factors of a power of 10 (2 or 5).
2082-
is_normalised = num & 1 and num % 5
2082+
is_normalised = num & 1 != 0 and num % 5 != 0
20832083
denom = pow10(-iexp)
20842084

20852085
if is_neg:

0 commit comments

Comments
 (0)