This document includes math equations (highlighted in red) which are best viewed with Firefox version 4.0 or higher, or another MathML-aware browser. There is also a PDF version of this document.
libdevice User's Guide (PDF) - v9.2.148 (older) - Last updated June 12, 2018 - Send Feedback

## 3.249. __nv_powf

Prototype:

    float @__nv_powf(float %x, float %y)

Description:

Calculate the value of `x` to the power of `y`

Returns:

- __nv_powf( ± 0 , `y`) returns ± ∞ for `y` an integer less than 0.

- __nv_powf( ± 0 , `y`) returns ± 0 for `y` an odd integer greater than 0.

- __nv_powf( ± 0 , `y`) returns +0 for `y` > 0 and not and odd integer.

- __nv_powf(-1, ± ∞ ) returns 1.

- __nv_powf(+1, `y`) returns 1 for any `y`, even a NaN.

- __nv_powf(`x`, ± 0 ) returns 1 for any `x`, even a NaN.

- __nv_powf(`x`, `y`) returns a NaN for finite `x` < 0 and finite non-integer `y`.

- __nv_powf(`x`, − ∞ ) returns + ∞ for | x | < 1 .

- __nv_powf(`x`, − ∞ ) returns +0 for | x | > 1 .

- __nv_powf(`x`, + ∞ ) returns +0 for | x | < 1 .

- __nv_powf(`x`, + ∞ ) returns + ∞ for | x | > 1 .

- __nv_powf( − ∞ , `y`) returns -0 for `y` an odd integer less than 0.

- __nv_powf( − ∞ , `y`) returns +0 for `y` < 0 and not an odd integer.

- __nv_powf( − ∞ , `y`) returns − ∞ for `y` an odd integer greater than 0.

- __nv_powf( − ∞ , `y`) returns + ∞ for `y` > 0 and not an odd integer.

- __nv_powf( + ∞ , `y`) returns +0 for `y` < 0.

- __nv_powf( + ∞ , `y`) returns + ∞ for `y` > 0.

Note:

For accuracy information for this function see the CUDA C Programming Guide, Appendix D.1, Table 6.

Library Availability:

Compute 2.0: Yes

Compute 3.0: Yes

Compute 3.5: Yes