How does -7 % 3 = 2, -13 % 3 = 2 or -1 % 3 = 2 exactly behaves under the hood? Ruby

后端 未结 0 1728
萌比男神i
萌比男神i 2020-12-01 13:33

I was curious what is the formula for negative number % positive number or vice versa. Ruby

-7 % 3 = 2

-13 % 3 = 2

-1 % 3 = 2

相关标签:
回答
  • 消灭零回复
提交回复
热议问题