RN1 wrote:

> On Dec 15, 12:33 am, "Anthony Jones" <(E-Mail Removed)> wrote:

>> "RN1" <(E-Mail Removed)> wrote in message

>>

>>
news:(E-Mail Removed)...

>>

>>> 79 Mod 92 evaluates to 79

>>

>>> 156 Mod 249 evaluates to 156

>>

>>> So while using the Mod operator, if the first number is less than

>>> the second number, will the result be ALWAYS EQUAL to the first

>>> number?

>>

>> Not exactly -390 is less than 79 but -390 mod 79 is 74.

>>

>> You might consider reading the documentation:-

>>

>> http://msdn2.microsoft.com/en-us/library/basszbdt.aspx

>>

>> Modulus is a standard mathematical operation:-

>>

>> http://mathworld.wolfram.com/Modulus.html

>>

>

> -19 Mod 7 evaluates to -5....that's fine but

>

> -19 Mod -7 also evaluates to -5. Why? Shouldn't it evaluate to 5?
-7 * 2 = -14

What do you have to add to -14 to get -19?

>

> Also how does 19 Mod -7 evaluate to 5 (& not -5)?
Again, -7 * -2 = 14. What do you have to add to 14 to get 19?

--

Microsoft MVP -- ASP/ASP.NET

Please reply to the newsgroup. The email account listed in my From

header is my spam trap, so I don't check it very often. You will get a

quicker response by posting to the newsgroup.