Jump to content

Gamma function: Difference between revisions

(→‎{{header|AWK}}: Remove dead line of code pertaining to unfinished Lanczos calculation.)
Line 4,708:
2.000000
2.778158</pre>
 
===Stirling===
 
<syntaxhighlight lang="txrlisp">(defun gamma (x)
(* (sqrt (/ (* 2 %pi%)
x))
(expt (/ x %e%) x)))
 
(each ((i 1..11))
(put-line (pic "##.######" (gamma (/ i 3.0)))))</syntaxhighlight>
 
{{out}}
 
<pre> 2.156976
1.202851
0.922137
0.839743
0.859190
0.959502
1.149106
1.458490
1.945403
2.709764</pre>
 
=={{header|Visual FoxPro}}==
543

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.