Dec 14, 2011 9:40 AM
How to calculate Remainder/Modulo from two integers

Like (0)
Hello all,
how do I create a calculation that returns the remainder from an integer division?
E.g:
10 divided by 3 > Returns 1
Any help would be much appreciated.
Thanks,
Hi
As part of your calculation, you may need to import System.Math as well, and use the DivRem method. See http://msdn.microsoft.com/enus/library/yda5c8dx.aspx#Y856 for details. I haven't actually tried it, but hopefully that may set you on the right track.
Cheers
Paul
Hi
I'd have thought the easiest way was to use the MOD operator as this returns the remainder.
So in a calculation:
Remainder of 10 divided by 3
would be:
10 % 3
Simples
Julian
Thank you Julian.
That did the job!
Thats good. remember to flag as solution.
