Andrew Morton
> i'm using director 8... this is really odd! i can get up to 99999*9999 and
> still get the correct answer... add one more 9, and while i do get a
> positive number, it is incorrect according to my handy calculator here, AND
> windows calculator.
> i don't know what to tell you... you're going to have to find a workaround
> of some sort.
There is a maximum integer that is supported by the system. In lingo, you
can test what the biggest integer is with the 'maxInteger' system property.
Eg.
-- Welcome to Director --
put the maxInteger
-- 2147483647
In 32-bit systems, this number is 2 to the power of 31 minus 1 (its 2 to the
power of 31, not 32, because the extra bit is used to sign the integer as
either positive or negative).
Signed-32bit integers are represented with four bytes. This makes them very
quick to process. If you are working with big numbers, then use floats which
can be bigger than 4 bytes (though processing floating numbers is inherently
slower than processing integers).
Incidently, if you type this into the message window
put power(2, 31)-1
-- 2147483647.0000
You will notice that the power function seems to automatically type-change
integers into floats, probably because the risk of creating big numbers.
However, if you multiply two integers -- then Director will try and keep
them as integers, even if the result is too big.
Luke
--
__________________________________________________________________________
Mecca Medialight Pty Ltd
Mecca Medialight: Medialight Sound Studio:
111 Moor Street 1 Bakehouse Lane
Fitzroy, Vic. 3065 North Fitzroy, Vic. 3068
Tel +613 9416 2033 Tel +613 9416 2033
Fax +613 9416 2055 Fax +613 9416 2055
http://www.medialight.com.au
__________________________________________________________________________