"
long int fac(unsigned long int n) {
return lround(exp(lgamma(n+1)));
}
"
Sounds great! What's the factorial of 40? Let's use some python:
>>> int(math.exp(math.lgamma(41)))
815915283247882431423526575245034982027017846784L
Huh, weird. I would've thought the factorial of 40 would be divisible by ten. Let's try it another way:
Prelude> let fac n = foldr1 (*) [1..n]
Prelude> fac 40
815915283247897734345611269596115894272000000000
The author's disdain for the lambda calculus, as if it is somehow not real math (because it doesn't involve numbers in the familiar sense?), is bizarre.