I'm looking for the modulus algorithm. I'm trying to make a modulus function that operates on a base N number (represented as a string most likely) but haven't had any luck when searching for it. Links are welcome.
I'm looking for the modulus algorithm. I'm trying to make a modulus function that operates on a base N number (represented as a string most likely) but haven't had any luck when searching for it. Links are welcome.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
I don't suppose this would work for you in some form, would it?
Code:int r = a - b * (int)( (double)a / b )
My best code is written with the delete key.
The modulus operation (as related to integers), works independently of the base.