Skip to content

Commit

Permalink
Fixed divmod result
Browse files Browse the repository at this point in the history
  • Loading branch information
FuexFollets committed Apr 17, 2023
1 parent eb5e7ad commit 11407f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/math-land/non_inplace_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def main():
print(f"val1 * val2: {val1 * val2}") # Calls __mul__
print(f"val1 // val2: {val1 // val2}") # Calls __floordiv__
print(f"val1 / val2: {val1 / val2}") # Calls __truediv__
print(f"divmod(val1, val2): {divmod(val1, val2)}") # Calls __divmod__

divided, modded = divmod(val1, val2) # Calls __divmod__
print(f"divmod(val1, val2): ({divided}, {modded})")
print(f"val1 % val2: {val1 % val2}") # Calls __mod__

print(f"math.floor(val1): {math.floor(val1)}") # Calls __floordiv__
Expand Down

0 comments on commit 11407f3

Please sign in to comment.