range error - or "How to take the factorial of a huge number"

Jim Witte jswitte at bloomington.in.us
Fri Apr 9 01:15:43 EDT 2004


> Type	Operators *: range error (overflow)

   Another possibility aside from recursion overflow (the more obvious 
one - I'm missing the forrest for the trees here) is that the number is 
just too big for whatever datatype MetaCard is using to represent 
numbers.  I don't know how you get around this one though, short of 
using a CPS'd function as an XCMD.  There *might* be a way to split the 
number up into smaller units, and then combine them at the end in some 
way, but I have no idea how - I'm thinking of the "Saturn" BCD 
architecture used by some calculators, and the recursive fast-multiply 
algorithm for multiplying truly huge numbers (hundreds or thousands of 
digits each..)

Jim



More information about the use-livecode mailing list