By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,502 Members | 1,177 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,502 IT Pros & Developers. It's quick & easy.

MOD and Remainder functions in c#

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

Thanks in advance,

Todd
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Wed, 20 Oct 2004 11:27:07 -0700, Todd wrote:
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.
Jul 21 '05 #2

P: n/a
<Chris Dunaway <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net">> wrote:
On Wed, 20 Oct 2004 11:27:07 -0700, Todd wrote:
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


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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

P: n/a
Thanks but i am looking for the answer using C#. That doesn't work in C#.

"Chris Dunaway" <"dunawayc[[at]_lunchmeat" wrote:
On Wed, 20 Oct 2004 11:27:07 -0700, Todd wrote:
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.

Jul 21 '05 #4

P: n/a
On Wed, 20 Oct 2004 20:49:29 +0100, Jon Skeet [C# MVP] wrote:
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.
Jul 21 '05 #5

P: n/a
On Wed, 20 Oct 2004 12:53:04 -0700, Todd wrote:
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.
Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.