Gamma function: Difference between revisions

→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}; output.
m (ANSI Standard BASIC, BASIC256, and BBC BASIC moved to the BASIC section.)
(→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}; output.)
Line 674:
 
=={{header|BASIC}}==
==={{header|ANSI Standard BASIC}}===
{{trans|BBC BASIC}} - Lanczos method.
{{works with|Decimal BASIC}}
<syntaxhighlight lang="ansi standard basic">100 DECLARE EXTERNAL FUNCTION FNlngamma
110
120 DEF FNgamma(z) = EXP(FNlngamma(z))
Line 702 ⟶ 703:
340 LET FNlngamma = (LOG(SQR(2*PI)) + LOG(a) - b) + LOG(b) * (z+0.5)
350 END FUNCTION</syntaxhighlight>
{{out}}
<pre>
.1 9.513507698670
.2 4.590843712000
.3 2.991568987689
.4 2.218159543760
.5 1.772453850902
.6 1.489192248811
.7 1.298055332647
.8 1.164229713725
.9 1.068628702119
1.0 1.000000000000
1.1 .951350769867
1.2 .918168742400
1.3 .897470696306
1.4 .887263817503
1.5 .886226925453
1.6 .893515349288
1.7 .908638732853
1.8 .931383770980
1.9 .961765831907
2.0 1.000000000000
</pre>
 
==={{header|BASIC256}}===
512

edits