MOD and Remainder functions in c#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can't find a Mod or remainder function in .net. Does anyone know if these
fuctions exist?
 
I can't find a Mod or remainder function in .net. Does anyone know if these
fuctions exist?

Did you look in the MSDN help? I started it up, selected the index and
typed Mod in the combo and lo and behold, there was the topic for the Mod
operator!! Amazing!

In brief:

A = 8 Mod 3


--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Did you look in the MSDN help? I started it up, selected the index and
typed Mod in the combo and lo and behold, there was the topic for the Mod
operator!! Amazing!

In brief:

A = 8 Mod 3

That doesn't look like C# to me (see subject line).

In C#, the remainder operator is %:

int a = 8 % 3; // a=2

There's also the Math.DivRem method, which allows you to get both the
quotient and remainder parts of a division operation in one go.
 
Thanks but i am looking for the answer using C#. That doesn't work in C#.

Chris Dunaway" <"dunawayc[[at]_lunchmeat said:
I can't find a Mod or remainder function in .net. Does anyone know if these
fuctions exist?

Did you look in the MSDN help? I started it up, selected the index and
typed Mod in the combo and lo and behold, there was the topic for the Mod
operator!! Amazing!

In brief:

A = 8 Mod 3


--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
That doesn't look like C# to me (see subject line).

Oops! I guess I need to read too!
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Thanks but i am looking for the answer using C#.

My apologies, I did not read carefully enough.
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Back
Top