http://en.wikipedia.org/wiki/Factorial#Computation You can not get as fast as C, unless you write a C extension. For practical purposes and non-gigantic numbers, I would just precompute all values we care about and store them in an array. -- Matma Rex 2012/2/17 Junayeed Ahnaf Nirjhor <zombiegenerator / aol.com>: > Hello, > > What is the most efficient way in Ruby to calculate the factorial of any > given sum? Is there any way to make it as fast as in C? > > Complexity doesn't matter as long as it works correctly. > -- > Junayeed Ahnaf Nirjhor > Core Developer Intern, Diaspora > Twitter - Nirjhor <http://twitter.com/nirjhor>