HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Modulo Operator | Hacker News Reader
Modulo Operator
offbeat.cc
2 points
·
susam
·
·
1 comment
Open article
Save
View on HN
danbst
·
Both are correct from math POV, but they differ in how "integer division" works.
Python floors `7 // -5` to -2, C rounds `7 / (-5)` to -1.
Reply on news.ycombinator.com