Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Different result of math.remainder() and % operator
Asked
Mar 31 '21 at 04:41
Active
Mar 31 '21 at 04:41
Viewed
26 times
1
Why are the amounts of this two different?
math.remainder(3,2)
and
3%2
python
python-3.x
asked Mar 31 '21 at 04:41
Ar So
21
4
Have you tried reading the docs? https://docs.python.org/3/library/math.html#math.remainder
–
kaya3
Mar 31 '21 at 04:49
math.remainder(3, 2) returns -1.0 for some reason
–
chess_lover_6
Mar 31 '21 at 04:50
1
Does this answer your question? [Difference between Python 3.7 math.remainder and %(modulo operator)](https://stackoverflow.com/questions/43845375/difference-between-python-3-7-math-remainder-and-modulo-operator)
–
ddejohn
Mar 31 '21 at 04:50
0 Answers
0