On Tue, May 13, 2008 at 6:49 PM, Ian Skinner <[EMAIL PROTECTED]> wrote: > Here is a CFML factorial function I made use of recently. I'll leave it > as a good exercise to port this code to JavaScript. > > <cffunction name="f" output="no" returntype="numeric"> > <cfargument name="integer" required="yes" type="numeric"> > > <cfset Var TheFactorial = 1> > > <cfloop condition="arguments.integer GT 0"> > <cfset TheFactorial = TheFactorial * arguments.integer> > <cfset arguments.integer = arguments.integer - 1> > </cfloop> > > <cfreturn TheFactorial> > </cffunction> > > > > >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/Javascript/message.cfm/messageid:5233 Subscription: http://www.houseoffusion.com/groups/Javascript/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.33
