## 3.154. __nv_fmod

Prototype:

double @__nv_fmod(double %x, double %y)



Description:

Calculate the double-precision floating-point remainder of x / y. The floating-point remainder of the division operation x / y calculated by this function is exactly the value x - n*y, where n is x / y with its fractional part truncated. The computed value will have the same sign as x, and its magnitude will be less than the magnitude of y.

Returns:

• Returns the floating-point remainder of x / y.

• __nv_fmod( $±0$ , y) returns $±0$ if y is not zero.

• __nv_fmod(x, $±\infty$ ) returns x if x is finite.

• __nv_fmod(x, y) returns NaN if x is $±\infty$ or y is zero.

• If either argument is NaN, NaN is returned.

Note:

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

Library Availability:

Compute 2.0: Yes

Compute 3.0: Yes

Compute 3.5: Yes