[ILUG] Re: impressive...

From: Colin Whittaker (grimnar at domain redbrick.dcu.ie)
Date: Thu 28 Oct 1999 - 14:57:22 IST


John P . Looney stated the following on Thu, Oct 28, 1999 at 02:46:22PM +0100 :
> Check this out.
>
> Into umb-scheme, type:
>
> (define (factorial number)(if (= number 0) 1 (* number (factorial (- number 1)))))
>
> then:
>
> (factorial 5500)
>
> How easy would it be to write a tcl, C or C++ function to get the
> factorial of 5500 ? Scheme rocks!

for c:

int factorial( int x )
{
        return ( x == 1 ): 1 ? (factorial( x - 1 ) * x);
}

-- 
		"Oh my god, bobb's a GIRL!" 
			-- 18/10/1999 -- Orly on gender and the colour mauve.


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:48 GMT