Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mod() function Bug?
Message
From
28/09/2006 11:51:33
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
 
 
To
23/09/2006 02:31:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01156435
Message ID:
01157873
Views:
20
OK, perhaps just a mention that the return when negative numbers are used will not be what you expect. By the way, is VB incorrect when it returns -1 or have they redefined the meaning of MOD to mean just the remainder when you divide by both negative and positive numbers?

The definition in the VFP help file reads 'Divides one numeric expression by another numeric expression and returns the remainder.' I am not a math guy so I just believed the definition given and, therefore, I would expect MOD(-13,4) to return -1.
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform