range error - or "How to take the factorial of a huge
Stephen Messimer
steve at messimercomputing.com
Fri Apr 9 09:15:03 EDT 2004
Jim
Thanks for your help. After looking at your first response I thought
that It might be possible to combine the two sets of calculations and
sum them but as it turns out the factorial of any number > 169 results
in an overflow error so it seems doing the factorials of numbers <= 169
and then those > 169 wouldn't work.
I will use the information you provided in your earlier post and see if
that works.
Again, I really appreciate your taking the time to help.
Best regards
Steve
On Friday, April 9, 2004, at 01:15 AM,
use-revolution-request at lists.runrev.com wrote:
>> 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
>
Stephen R. Messimer, PA
208 1st Ave. South
Escanaba, MI 49829
http://www.messimercomputing.com
--
Build Computer-Based Training modules FAST with preceptorTools™ --
version 1.0.5 available Now!
More information about the use-livecode
mailing list