I am having a tough time googling /=... can anyone tell me what this code does?
number = digits[n % digits.Length] + number;
n /= digits.Length;
My intent is to determine what the remainder of this operation is... so I know when to stop or keep going.
This is the division assignment operator operator meaning n = n/digits.Length
See MSDN: /= Operator (C# Reference) for details.
Just to add to what has already been posted in various answers, a compound assignment operator $= (replace $ with a binary operator) is similar to an assignment with the binary operator used in the right-hand side. The difference is that the left-hand side is evaluated only once. So:
x $= y
x is evaluated only once.
x = x $ y
x is evaluated twice.
Unlikely to make a difference in practice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With