Thanks for the reply. I actually have an even worse problem with mod at

this point, and the sign is just one part of it. As far as I can tell, the

Mod function should be the amount by which a number exceeds the largest

integer multiple of the divisor that is not greater than that number. This

definition leads to some inconsistencies I'll have to sort through in order

to figure this out. The problem is that Mod in VB truncates toward zero,

which is throwing these calculations wayyyy off. I need a formula that

truncates toward -infinity.

"AMercer" <AM*****@discussions.microsoft.com> wrote in message

news:3D**********************************@microsof t.com...

for m mod n with sign of m ignored and sign of n used, try

abs(m mod n)*sign(n)

abs and sign are in system.math.

"Michael C#" wrote:

A statement of the form (m mod n) uses the sign of the first operand (m)

as

the sign of the result. I've ecnountered an issue where I need it to use

the sign of the second operand. Here's what it looks like now:

-363 mod -60 = -3

-363 mod 60 = -3

363 mod -60 = 3

Anyone have any ideas? Thanks.