Public Function ModStd( _ ByVal vX As Variant _ , ByVal vY As Variant _ ) As Variant
Y = 4 or Y = -4:
| * * * | * * * |* * * ---*---*---*---*---*--- * * *| * * * | * * * |
ModStd(0, 3) = 0 ModStd(1, 3) = 1 ModStd(2, 3) = 2 ModStd(3, 3) = 0 ModStd(4, 3) = 1 ModStd(-1, 3) = -1 ModStd(-2, 3) = -2 ModStd(-2, -3) = -2 ModStd(2, -3) = 2See also:
ModStdVerify Subroutine ModAlt Function ModSym Function ModOffsetByOne Function Mod Operator (Visual Basic) Fix Function (Visual Basic)Note: Differs from the ModAlt function when X is negative and Y is positive. We believe that the other definition of the modulo function in ModAlt is much more widely accepted than this definition (ModStd is similar to the definition that Microsoft implements in all of their language products).
vX: See the Definition. Function returns Null if vX is Null or cannot be fixed up to a number.
vY: See the Definition. Function returns Null if vY is Null or cannot be fixed up to a number.
Definition:
X - Y * Fix(X / Y)
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.