Page 1 of 1

Working with large numbers in LiveCode

Posted: Wed Jun 04, 2014 12:56 pm
by andrewferguson
Hello,
I have just started a program that works with large numbers (not for any particular reason, I was just bored). However, when I try and calculate a really large number (for example 2^2^2^2^2^2), I get the result "00000inf". I know this is probably beyond the limits of what LiveCode can process, but is there any way to increase the limit of what LiveCode can calculate?
Thanks,
Andrew

Re: Working with large numbers in LiveCode

Posted: Wed Jun 04, 2014 3:42 pm
by Klaus
Hi Andrew,

you could try to set "the numberformat" to its max, whatever that is.
But I'm sure you will tell us :D


Best

Klaus

Re: Working with large numbers in LiveCode

Posted: Wed Jun 04, 2014 3:58 pm
by dunbarx
Hi.

I can never remember exactly, but you will encounter errors if the result of any arithmetic calculations requires more than about 16 decimal digits of precision.

Craig Newman

Re: Working with large numbers in LiveCode

Posted: Wed Jun 04, 2014 7:20 pm
by andrewferguson
Hi Craig,
The thing is, my program is not working with decimal places, all numbers generated are integers.

In answer to Klaus, I have tried setting the numberFormat to various values, and it changes nothing. I am not sure what to do next. Any advice?

Thanks again,
Andrew

Re: Working with large numbers in LiveCode

Posted: Thu Jun 05, 2014 1:12 am
by dunbarx
The numberformat is a display tool. Wonderful but has no effect on the underlying value.

I meant integers in my post. If you multiply two 15 digit numbers, you will lose all sense of accuracy in about the 16th place.

Craig