[comp.unix.programmer] factorial...

josevela@mtecv2.mty.itesm.mx (Jose Angel Vela Avila) (02/05/91)

 Hi, does any body knowk wich is the greatest factorial in a Unix box ?

 We are having trouble trying to do the factorial of 10000 :-)

 Any help would be apreciated..

Thanks

bhoughto@hopi.intel.com (Blair P. Houghton) (02/05/91)

In article <2853@mtecv2.mty.itesm.mx> josevela@mtecv2.mty.itesm.mx (Jose Angel Vela Avila) writes:
> Hi, does any body knowk wich is the greatest factorial in a Unix box ?

As in the largest, or the best? :-)

> We are having trouble trying to do the factorial of 10000 :-)

RTFM bc(1).

				--Blair
				  "Foo."

dik@cwi.nl (Dik T. Winter) (02/07/91)

In article <1991Feb06.072529.21092@convex.com> bobm@convex.com (Bob Miller) writes:
 > I spent a little time optimizing and vectorizing, and for sufficiently
 > large numbers, I can multiply a decimal digit-pair every 15
 > picoseconds (!).  "Sufficiently large" means > 1e36000.
 > 
Let me guess, Schoenhage?, Fourier transform?
--
dik t. winter, cwi, amsterdam, nederland
dik@cwi.nl

tif@doorstop.austin.ibm.com (Paul Chamberlain) (02/07/91)

josevela@mtecv2.mty.itesm.mx (Jose Angel Vela Avila) writes:
> We are having trouble trying to do the factorial of 10000 :-)

I don't know if the smiley makes this a joke or not but I can't resist
a challenge.  A RISC System/6000 Model 930 running bc did this in:
	real	14m25.13s
	user	14m10.08s
	sys	0m3.46s
and came up with 35660 digits, available if you really want them.  Here
is the bc program just in case you're curious.
	define f(n) {
		auto x
		x = 1
		for (n; n>1; n--) {
			x = x * n
		}
		return(x)
	}
	f(10000)
	quit

Paul Chamberlain | I do NOT speak for IBM.          IBM VNET: PAULCC AT AUSTIN
512/838-9662     | ...!cs.utexas.edu!ibmchs!auschs!doorstop.austin.ibm.com!tif