Re: Why int remainder=(int)(Math.DivRem(MaxValue, 2, out remainder)) is 5 where int MaxValue = 10!!!;

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




int remainder=(int)(Math.DivRem(MaxValue, 2, out remainder));


the out parameter is overwritten by the return value.


Perhaps want you want to do is:


int remainder;
int result = (int)(Math.DivRem(MaxValue, 2, out remainder));


ben
.