JavaScript % (modulo) gives a negative result for negative numbers
Asked 07 September, 2021
Viewed 912 times
  • 57
Votes

According to Google Calculator (-13) % 64 is 51.

According to Javascript (see this JSBin) it is -13.

How do I fix this?

11 Answer