Can anyone tell me if there is a function to get just the remainder of an
integer division in C#? Other languages have functions like DIV(x,y), etc.
Thanks,
James Knowlton
Printable View
Can anyone tell me if there is a function to get just the remainder of an
integer division in C#? Other languages have functions like DIV(x,y), etc.
Thanks,
James Knowlton
Yes, there is, the modulus operator (%)
f.i
Console.WriteLine(-5 % 2);
output -1
Willy.
"James Knowlton" <james.knowlton@impactinnovations.com> wrote in message
news:3ad948af$1@news.devx.com...
> Can anyone tell me if there is a function to get just the remainder of an
> integer division in C#? Other languages have functions like DIV(x,y),
etc.
>
> Thanks,
>
> James Knowlton
>
>
Thanks for the info!
James.
"WillyD" <willy.denoyette@pandora.be> wrote in message
news:3ad95c19$1@news.devx.com...
> Yes, there is, the modulus operator (%)
> f.i
> Console.WriteLine(-5 % 2);
>
> output -1
>
> Willy.
>
>
> "James Knowlton" <james.knowlton@impactinnovations.com> wrote in message
> news:3ad948af$1@news.devx.com...
> > Can anyone tell me if there is a function to get just the remainder of
an
> > integer division in C#? Other languages have functions like DIV(x,y),
> etc.
> >
> > Thanks,
> >
> > James Knowlton
> >
> >
>
>