Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modulus 97 on a very large number
Message
From
06/03/2007 11:42:06
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01200962
Message ID:
01201081
Views:
19
>Hi all,
>
>can someone tell me how I can calculate the modulus 97 on a number with 23 digits ? It seems that the MOD function has a problem with the large number. Is there another option ??

You could use maths... subtract the largest value of 97*10**n that can fit your number... but do it as a string:

- have the original 23-digit number as a string.
- divide it into groups of, say, 6 digits each.
- find the mod(group1,97) of the leftmost group.
- add the digits you got to the second group
- find the mod(mod1*1000000+group2, 97)
- repeat that with 3rd and 4th group.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform