syclreference.com
  1. SYCL
  2. | API Reference
  3. | Built-Ins
  4. | sign

sign

Returns 1.0 if x > 0, -0.0 if x = -0.0, +0.0 if x = +0.0, or -1.0 if x < 0. Returns 0.0 if x is a NaN.


template <typename F, typename return_t, detail::enable_if_t<(detail::builtin::is_genfloat<F>::value), int> >
return_t sign(const F x)
(1)
  1. Returns 1.0 if x > 0, -0.0 if x = -0.0, +0.0 if x = +0.0, or -1.0 if x < 0. Returns 0.0 if x is a NaN.
    Parameters:
    • const F x

syclreference.com — SYCL Reference Pages

Last updated: 2019-01-24 00:24:52 +0000