Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Math Whiz - Frankenbach ?
Message
From
16/02/2005 09:18:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
16/02/2005 04:23:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00987308
Message ID:
00987398
Views:
24
>>int(10/3) gives you the first three parts, i.e., 3.
>>
>>10 % 3 - or the equivalent, mod(10, 3), gives you the remainder.
>>
>>Or, using your variables:
>>
>>All numbers but the last are equal to int (v / (n-1))
>>
>>The last number is v % (n-1)
>
>Try with n=2 Expected is (5,5).

I expect the remainder of an integer division by "x" to be in the range 0 to (x-1). AFAIK, this is exactly what VFP does.

If something else is required, additional adjustments have to be done.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform