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) - v7.0 (older) - Last updated March 5, 2015 - Send Feedback -

## 3.231. __nv_modf

Prototype:

    double @__nv_modf(double %x, double* %b)

Description:

Break down the argument `x` into fractional and integral parts. The integral part is stored in the argument `iptr`. Fractional and integral parts are given the same sign as the argument `x`.

Returns:

- __nv_modf( ± x , `iptr`) returns a result with the same sign as `x`.

- __nv_modf( ± ∞ , `iptr`) returns ± 0 and stores ± ∞ in the object pointed to by `iptr`.

- __nv_modf(NaN, `iptr`) stores a NaN in the object pointed to by `iptr` and returns a NaN.

Note:

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

Library Availability:

Compute 2.0: Yes

Compute 3.0: Yes

Compute 3.5: Yes