gamma() — Calculate gamma function

Standards

Standards / Extensions C or C++ Dependencies

SAA
XPG4
XPG4.2

both  

Format

#include <math.h>

double gamma(double x);

Compiler option: LANGLVL(SAA), LANGLVL(SAAL2), or LANGLVL(EXTENDED)

General description

gamma() provides the same function as lgamma(), including the use of signgam. Use of lgamma() instead of gamma() is suggested by XPG4.2.

Note:

This function is kept for historical reasons. It was part of the Legacy Feature in Single UNIX Specification, Version 2, but has been withdrawn and is not supported as part of Single UNIX Specification, Version 3. New applications should use lgamma() instead of gamma().

If it is necessary to continue using this function in an application written for Single UNIX Specification, Version 3, define the feature test macro _UNIX03_WITHDRAWN before including any standard system headers. The macro exposes all interfaces and symbols removed in Single UNIX Specification, Version 3.

Related information