Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug : MOD() is mistaken for nDivisor negative
Message
From
04/01/2005 10:11:34
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00974018
Message ID:
00974076
Views:
15
>Fabio,
>
>The MOD() function and % operator both return correct result (modulus). The help incorrectly calls it remainder. See references in Re: MOD() vs % (sql-syntax) Message #973898.

I do not have necessity to read it, because it is much easy one to change the definition in order to obtain the VFP result.

But for curiosity I have read.

Well.

The definition for MOD() in Excel 97:
http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/office97/html/output/f1/d6/s5b270.asp
call it Remainder then Doctor Peterson change the definition
of remainder.

This link explain the Excel behaviour,
this proof that this is not a by design behaviour,
but a by side behaviour:
http://support.microsoft.com/default.aspx?scid=kb;en-us;141178

Of course, on Excel for Italy,
MOD() is translated to RESTO() ( = REMAINDER ) .

The thing is enough comic:
when one developer mistakes an algorithm,
the algorithm comes used from others and becomes one new definition
(is one mutation) accepted from the community;
to this point a turn professor invents one new definition that formalizes the mutation.

Sure in MS mod and remainder are the same:
Search ( mod remainder ) for:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsoprmod.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_pluslang_c.2b2b_.multiplicative_operators.asp
http://longhorn.msdn.microsoft.com/lhsdk/ndp/vaoprmod.aspx
....

Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform