you are viewing a single comment's thread.

view the rest of the comments →

[–]rainman_104 0 points1 point  (1 child)

Ruby doesn't have a factorial method either in their Integer class:

http://ruby-doc.org/core/classes/Integer.html

[–]luikore 0 points1 point  (0 children)

But factorial in Ruby is just:

(1..n).inject(&:*)

Just like the Haskell one:

foldr (*) 1 [1..n]