I\'m going crazy: Where is the Ruby function for factorial? No, I don\'t need tutorial implementations, I just want the function from the library. It\'s not in Math!
Here is my version seems to be clear to me even though it's not as clean.
def factorial(num) step = 0 (num - 1).times do (step += 1 ;num *= step) end return num end
This was my irb testing line that showed each step.
num = 8;step = 0;(num - 1).times do (step += 1 ;num *= step; puts num) end;num