Gamma function: implementation?

Doug Gwyn gwyn at smoke.BRL.MIL
Sun Sep 17 10:16:22 AEST 1989


In article <430008 at hpqtdla.HP.COM> bww at hpqtdla.HP.COM (Brian Woodroffe) writes:
>I am trying to implement a port of a program that calls for a
>"gamma" function.  Unfortunately the compiler / math's library
>I am using does not have such a function.

Check for a "log of gamma" function.  Because gamma grows at a rapid
rate, that's generally a more useful function (usually called lgamma()).

>As second question; what is a gamma function anyway? (I understand
>that a factorial is the degenerate integer case.)  And what is a
>gamma function used for and where?

Heavens, they have lots of applications.  Look in a few textbooks.

For an implementation, check out Chapter 6 of Press, Flannery,
Teukolsky, & Vettering's "Numerical Recipes in C".



More information about the Comp.lang.c mailing list