Integer-Calculation with 24 decimals?
kee nethery
kee at kagi.com
Tue Nov 13 13:19:20 EST 2012
For this, I'd do it "by hand". Treat the numbers as text in a field rather than digits and follow the same process you would if you were to do this on paper.
For modulo I'd start by making a list of multiples of 97 and start manually subtracting them.
for example,
1234516789012345678901234
-970000000000000000000000
264516789012345678901234
264516789012345678901234
-2 * 97000000000000000000000
=70516789012345678901234
rinse and repeat.
should be easy enough to do the subtraction and carry and such in code.
Eventually you end up with the modulo.
--
Easy enough to do the same thing with all the other math functions.
Kee
On Nov 13, 2012, at 7:41 AM, R. Hillen <mail at richard-hillen.de> wrote:
> Hello list,
>
> I have to do a lot of calculations like 1234516789012345678901234 mod 97; (always 24 decimals)
>
> IntegerCalculation in LC with 24 decimals doesn´t work valide.
>
> Does anyone of you know of an external function or a mathematical trick or …
>
> Thank you in advance!
>
> Richard.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list