How on Factorial

Bj Raz whitequill.bj at gmail.com
Thu Oct 28 06:12:39 EDT 2010


I'm working on some factorial stuff myself, and I'm running into that issue
that the CPU or ALU (Algorithmic Logical Unit), isn't powerful enough to
compute the numbers I'm trying to produce, including the OS has its own
number crunching limitation for accuracy.

To accurately generate the numbers I want I'd probably need about 200+ 64
bit CPUs or ALUs, thats about 640,000 bit Long.  I can produce about 100
places of accuracy with my i7-950 I think.

@geobird or anyone: does someone have an idea of how to bridge this issue?

Here is what I have in MATLAB currently, I have heard of;
SAGE<http://www.sagemath.org/>,
which I've heard is a good alternative to MATLAB.
Here is the script I have from MATLAB; http://pastebin.com/sc1jW1n4, it
takes the natural log of the number huge numbers being generated, and allows
you to work with gigantic numbers more easily.

I don't know how to write this naively into python though without being able
to call functions.
I'm working with differential equations related the the higher roots of -1
(negative one).

On Wed, Oct 27, 2010 at 5:13 AM, Jussi Piitulainen <
jpiitula at ling.helsinki.fi> wrote:

> Geobird writes:
>
> > @ Ulrich : Tx
> > @ Rebert : Appreciate your interpretation.
> >            It  made  me think about ternary operation . Say
> >  >>> (a > b) and x or y
> >
> >    Are all ternary operations prone to ...( in your words )
> >    > It exploits short-circuit evaluation
> >    >(http://en.wikipedia.org/wiki/Short-circuit_evaluation ). This is
> >    >stunt coding / code golf; no one should actually write factorial
> > like
> >    >that.
>
> The purpose of a conditional expression is to select one branch of
> computation and avoid another. Other ternary operations might well
> use the values of all three arguments.
>
> (I agree that no one should write factorial like that, except as
> a joke. I have nothing against (x if (a > b) else y). The trick
> with and and or was used before Python had an actual conditional
> expression.)
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101028/70ab8e06/attachment-0001.html>


More information about the Python-list mailing list