Sep-08-2024, 07:46 AM
import math print(math.remainder(7, 2))
Output:-1.0Shouldn't the output be 1.0?
Then ...
import math print(math.remainder(33, 2))
Output:1.0Then I tried ...import math print(math.remainder(5, 2)
Output:1.0What I could gather is that if the dividend (the number which is divided) is a power of 2 plus 1 (2n + 1), we get a remainder 1, but if it isn't we get a remainder of -1.0.What's going on?
