PRB: MOD Function w/ Negative Number May Give Different AnswerID: Q130128 3.00 WINDOWS
The information in this article applies to:
SYMPTOMSIf negative numbers are used with the MOD function, it is possible that the answer returned will be different from the answer given by other applications that also incorporate a MOD function.
CAUSEThe correct definition of MOD is as follows:
Therefore:
In the Microsoft MOD function, we do the same as above except we use the
FLOOR() function instead of INT() in order to be backward compatible with
other products that use the FLOOR() function.
RESOLUTIONBelow are two functions. The first function (FLOORMOD) implements the MOD with a FLOOR() function, and the second function (INTMOD) implements the MOD with an INT() function. Sometimes you may want to use the INTMOD function.
STATUSThis behavior is by design. Additional reference words: 3.00 VFoxWin KBSubcategory: FxprgGeneral
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |