Scripting competition

Brian Yennie briany at qldlearning.com
Mon May 11 23:45:40 EDT 2009


In short, the number gets too big -- for example, if you are working  
with 32 bit integers, anything over 2^32 is out of range and will  
"roll over" or other such wonkiness.

> Now that folks have posted some solutions that apparently work, can  
> someone
> explain why using a simple algorithm doesn't?
>
> function findFib pNum
>  put 0 into num1
>  put 1 into num2
>  repeat pNum - 1
>     put num1 + num2 into num3
>     put num2 into num1
>     put num3 into num2
>  end repeat
>  return num3
> end findFib
>
> There's no decimals involved (unless you use a formula, which I've  
> been
> trying to do) so what limitation is the computer running up against?
>
> Thanks for answering the mathemalacking of us.
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design



More information about the use-livecode mailing list