3.317. __nv_tgammaf

float @__nv_tgammaf(float %x)

Calculate the gamma function of the input argument.

Calculate the gamma function of the input argument x, namely the value of \(\int_{0}^{\infty} e^{-t}t^{x-1}dt\).

Note

For accuracy information, see the CUDA C++ Programming Guide, Mathematical Functions Appendix, Single-Precision Floating-Point Functions section.

Returns

  • __nv_tgammaf( \(\pm 0\) ) returns \(\pm \infty\).

  • __nv_tgammaf(2) returns +0.

  • __nv_tgammaf(x) returns \(\pm \infty\) if the correctly calculated value is outside the double floating point range.

  • __nv_tgammaf(x) returns NaN if x < 0.

  • __nv_tgammaf( \(-\infty\) ) returns NaN.

  • __nv_tgammaf( \(+\infty\) ) returns \(+\infty\).