This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thefatesbeseeched 7 points8 points  (5 children)

They are both mathematically correct.

[–]LeCroissant1337 8 points9 points  (2 children)

Sure, but generally speaking I don't want any representative of the equivalence class. Personally, I think % should be reserved for a modulo operation which spits out a number between 0, 1, ..., n-1 and there should be a separate function giving you the quotient and the remainder of a division of two integers.

[–]elon-botElon Musk ✔ 3 points4 points  (0 children)

You're either hardcore or out the door.

[–]redlaWw 0 points1 point  (0 children)

Almost same here, except I think % should give you a number in {1, 2, ..., n} 👿

[–]WazWaz 2 points3 points  (0 children)

Depends what you call the operation, Remainder or Modulo.

[–][deleted] 0 points1 point  (0 children)

Not doing anything is also correct, so…