Chapter Contents

Previous

Next
tgamma

tgamma



Compute the gamma function

Portability: C99


SYNOPSIS
DESCRIPTION
RETURN VALUE
DIAGNOSTICS
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

   #include <math.h>

   double tgamma(double x);
   float tgammaf(float x);
   long double tgammal(long double x);


DESCRIPTION

tgamma computes the gamma function of its argument, x. The value returned by tgamma is defined by this equation:

[IMAGE]

The function name tgammaf should be used for float arguments, and tgammal for long double arguments. Alternately, if the header file tgmath.h is included, tgamma may be used with any numeric argument type.


RETURN VALUE

tgamma returns the gamma function of its argument, if it is defined and representable.


DIAGNOSTICS

If the argument of tgamma is invalid, it returns HUGE_VAL in hexadecimal floating point, or a NaN in binary floating point. If the result of tgamma overflows, it returns HUGE_VAL in hexadecimal floating point, and either an infinity or the maximum finite value, depending on the rounding mode in binary floating-point. In these cases, the run-time library writes an error message to the standard error file (stderr).


RELATED FUNCTIONS

gamma, lgamma


SEE ALSO

"Mathematical Functions" in Chapter 2, "Function Categories"


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.