Hello there!

I would like to ask for you help.

In order to calculate the check number, I have to determine the division of
a 21 digits number by 97 and for that I use the MOD () command.

The problem is that Fox only uses 15 digits for numeric values, and I would
need to get the result more then only 15 digits.

The command is mod(2500003842908003100,97)

Do you know how I can solve this problem?

Thanks in advance,

Pedro

PS - sorry for the bad English

Re: In order to calculate the check number by Rick

Rick
Tue Mar 28 17:17:04 CST 2006

Pedro,
Go to the UT (http://www.universalthread.com/wconnect/wc.dll?2,54,1,5) and
download ID 10044. This has large number functions (including MOD()).

Rick

"Microsoft" <pedro.branquinho@sapo.pt> wrote in message
news:O134YvrUGHA.4156@TK2MSFTNGP10.phx.gbl...
> Hello there!
>
> I would like to ask for you help.
>
> In order to calculate the check number, I have to determine the division of a
> 21 digits number by 97 and for that I use the MOD () command.
>
> The problem is that Fox only uses 15 digits for numeric values, and I would
> need to get the result more then only 15 digits.
>
> The command is mod(2500003842908003100,97)
>
> Do you know how I can solve this problem?
>
> Thanks in advance,
>
> Pedro
>
> PS - sorry for the bad English
>
>


Re: In order to calculate the check number by Bernhard

Bernhard
Wed Mar 29 03:44:38 CST 2006

Hi Pedro,

> The problem is that Fox only uses 15 digits for numeric values, and I would
> need to get the result more then only 15 digits.
>
> The command is mod(2500003842908003100,97)

With a little math you could find this solution:
cut your big number in two pieces: one piece is the last 10 digits, I call it
z2, the other piece consists of the leading digits, I call it z1.
Then the modulus for the whole number calculates like this:

mod (largeNum, 97) = mod(mod(10**10, 97) * mod(z1, 97) + mod(z2, 97)), 97)

this formula is based on the fact, that the said cut is mathematically described as:
largeNum = 10**10 * z1 + z2

Regards
Bernhard Sander

Re: In order to calculate the check number by Olaf

Olaf
Wed Mar 29 11:06:22 CST 2006

> mod (largeNum, 97) = mod(mod(10**10, 97) * mod(z1, 97) + mod(z2, 97)), 97)
>
> this formula is based on the fact, that the said cut is mathematically
> described as:
> largeNum = 10**10 * z1 + z2
There's one closing bracket too much, otherwise okay.

I'd put it that way. First have a look at this simpler example:
Mod(1234,11)
=Mod(Mod(1234,1100),11)
=Mod(Mod(1200,1100)+34,11)
=Mod(Mod(12,11)*100+34,11)
=Mod( 1*100+34,11)
=Mod( 134,11)


This is the same strategy of splitting the number 1234 into the parts
12 and 34. We nested two Mod()s, the inner Mod(12,11) and the
outer Mod(134,11).

So again, let z1 be the first 9 and z2 be the last 10 digits of those 19
digit
large number, then:

Mod(largenumber,97) =Mod(z1*10^10+z2,97)
=Mod(Mod(z1,97)*10^10+z2,97)

Let z1 and z2 be strings, then it's:
largenumber="2500003842908003100"
z1 = left(largenumber,9)
z2 = substr(largenumber,len(z1)+1)
? Mod(Val(Str(Mod(Val(z1),97))+z2),97)

Bye, Olaf.