1 '\" te
   2 .\" Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
   3 .\" Portions Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
   4 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at 
   5 .\" http://www.opengroup.org/bookstore/.
   6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   7 .\"  This notice shall appear on any product containing this material.
   8 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
  10 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  11 .TH tgamma 3M "12 Jul 2006" "SunOS 5.11" "Mathematical Library Functions"
  12 .SH NAME
  13 tgamma, tgammaf, tgammal \- compute gamma function
  14 .SH SYNOPSIS
  15 .LP
  16 .nf
  17 c99 [ \fIflag\fR... ] \fIfile\fR... \fB-lm\fR [ \fIlibrary\fR... ]
  18 #include <math.h>
  19 
  20 \fBdouble\fR \fBtgamma\fR(\fBdouble\fR \fIx\fR);
  21 .fi
  22 
  23 .LP
  24 .nf
  25 \fBfloat\fR \fBtgammaf\fR(\fBfloat\fR \fIx\fR);
  26 .fi
  27 
  28 .LP
  29 .nf
  30 \fBlong double\fR \fBtgammal\fR(\fBlong double\fR \fIx\fR);
  31 .fi
  32 
  33 .SH DESCRIPTION
  34 .sp
  35 .LP
  36 These functions compute the \fBgamma()\fR function of \fIx\fR.
  37 .SH RETURN VALUES
  38 .sp
  39 .LP
  40 Upon successful completion, these functions return \fBgamma\fR(\fIx\fR).
  41 .sp
  42 .LP
  43 If \fIx\fR is a negative integer, a domain error occurs and a NaN is returned.
  44 .sp
  45 .LP
  46 If the correct value would cause overflow, a range error occurs and
  47 \fBtgamma()\fR, \fBtgammaf()\fR, and \fBtgammal()\fR return the value of the
  48 macro \(+-\fBHUGE_VAL\fR, \(+-\fBHUGE_VALF\fR, or \(+-\fBHUGE_VALL\fR,
  49 respectively.
  50 .sp
  51 .LP
  52 If \fIx\fR is NaN, a NaN is returned.
  53 .sp
  54 .LP
  55 If \fIx\fR is \(+-Inf, \fIx\fR is returned.
  56 .sp
  57 .LP
  58 If x is \(+-0, a pole error occurs and \fBtgamma()\fR, \fBtgammaf()\fR, and
  59 \fBtgammal()\fR return \(+-\fBHUGE_VAL\fR, \(+-\fBHUGE_VALF\fR, and
  60 \(+-\fBHUGE_VALL\fR, respectively.
  61 .sp
  62 .LP
  63 If \fIx\fR is +Inf, a domain error occurs and a NaN is returned.
  64 .SH ERRORS
  65 .sp
  66 .LP
  67 These functions will fail if:
  68 .sp
  69 .ne 2
  70 .mk
  71 .na
  72 \fBDomain Error\fR
  73 .ad
  74 .RS 16n
  75 .rt  
  76 The value of \fIx\fR is a negative integer or \fIx\fR is \(miInf.
  77 .sp
  78 If the integer expression (\fBmath_errhandling\fR & \fBMATH_ERREXCEPT\fR) is
  79 non-zero, then the invalid floating-point exception is raised.
  80 .RE
  81 
  82 .sp
  83 .ne 2
  84 .mk
  85 .na
  86 \fBPole Error\fR
  87 .ad
  88 .RS 16n
  89 .rt  
  90 The value of \fIx\fR is zero.
  91 .sp
  92 If the integer expression (\fBmath_errhandling\fR & \fBMATH_ERREXCEPT\fR) is
  93 non-zero, then the divide-by-zero floating-point exception is raised.
  94 .RE
  95 
  96 .sp
  97 .ne 2
  98 .mk
  99 .na
 100 \fBRange Error\fR
 101 .ad
 102 .RS 16n
 103 .rt  
 104 The value overflows.
 105 .sp
 106 If the integer expression (\fBmath_errhandling\fR & \fBMATH_ERREXCEPT\fR) is
 107 non-zero, then the overflow floating-point exception is raised.
 108 .RE
 109 
 110 .SH USAGE
 111 .sp
 112 .LP
 113 An application wanting to check for exceptions should call
 114 \fBfeclearexcept\fR(\fBFE_ALL_EXCEPT\fR) before calling these functions. On
 115 return, if \fBfetestexcept\fR(\fBFE_INVALID\fR | \fBFE_DIVBYZERO\fR |
 116 \fBFE_OVERFLOW\fR | \fBFE_UNDERFLOW\fR) is non-zero, an exception has been
 117 raised. An application should either examine the return value or check the
 118 floating point exception flags to detect exceptions.
 119 .SH ATTRIBUTES
 120 .sp
 121 .LP
 122 See \fBattributes\fR(5) for descriptions of the following attributes:
 123 .sp
 124 
 125 .sp
 126 .TS
 127 tab() box;
 128 cw(2.75i) |cw(2.75i) 
 129 lw(2.75i) |lw(2.75i) 
 130 .
 131 ATTRIBUTE TYPEATTRIBUTE VALUE
 132 _
 133 Interface StabilityStandard
 134 _
 135 MT-LevelMT-Safe
 136 .TE
 137 
 138 .SH SEE ALSO
 139 .sp
 140 .LP
 141 \fBfeclearexcept\fR(3M), \fBfetestexcept\fR(3M), \fBlgamma\fR(3M),
 142 \fBmath.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5)