Just recently I stumbled upon a problem using the (what I assumed to be modulo) operator %
:
Basically (-1) % 5
returns -1
instead of 4
, so %
seems to return the remainder instead of the mathematically correct modulus (either that or Wolfram Alpha is bad at math).
My question is quite simple: Is there a real modulo operator in C# that I don't know of? Or do I have to write my own code for that?
All results I can find in the internet only point to the %
...