Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does MOD() work?
Message
 
To
10/12/1999 23:38:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00302170
Message ID:
00302174
Views:
28
>>From the VFP5 help file...
>>
>>? MOD(36,10) && Displays 6
>>? MOD((4*9), (90/9)) && Displays 6
>>? MOD(25.250,5.0) && Displays 0.250
>>
>>I agree with the first two but why does the last
>>one display .250 when 25.25/5=5.05?
>>
>>Similarly ? mod(1999,4) displays 3 instead of 75.
>>
>>What am I missing?
>
>The modulo (MOD()) function returns the remainder, when the first argument is divided by the second. Just like the old way of doing long division by hand, that used to be taught in grade school.
>
>
>25.25 = (5 * 5.0) + 0.250
>1999 = (499 * 4) + 3
>
Sorry... It's late... I was just expecting the fractional part
of the division.
Previous
Reply
Map
View

Click here to load this message in the networking platform