3.120. __nv_fdim

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

Compute the positive difference between x and y.

Compute the positive difference between x and y. The positive difference is x - y when x > y and +0 otherwise.

Note

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

Returns

Returns the positive difference between x and y.

  • __nv_fdim(x, y) returns x - y if x > y.

  • __nv_fdim(x, y) returns +0 if x \(\leq\) y.