We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 994e466 commit 18d1ad2Copy full SHA for 18d1ad2
pendulum/duration.py
@@ -24,8 +24,9 @@ def _divide_and_round(a, b):
24
# in Objects/longobject.c.
25
q, r = divmod(a, b)
26
27
- if isinstance(q, float):
28
- q = int(q)
+ # The output of divmod() is either a float or an int,
+ # but we always want it to be an int.
29
+ q = int(q)
30
31
# round up if either r / b > 0.5, or r / b == 0.5 and q is odd.
32
# The expression r / b > 0.5 is equivalent to 2 * r > b if b is
0 commit comments