Nearest integer floating point operations

template <class T, std::size_t N>
batch<T, N> xsimd::ceil(const batch<T, N> &x)

Computes the batch of smallest integer values not less than scalars in x.

Return
the batch of smallest integer values not less than x.
Parameters
  • x: batch of floating point values.

template <class T, std::size_t N>
batch<T, N> xsimd::floor(const batch<T, N> &x)

Computes the batch of largest integer values not greater than scalars in x.

Return
the batch of largest integer values not greater than x.
Parameters
  • x: batch of floating point values.

template <class T, std::size_t N>
batch<T, N> xsimd::trunc(const batch<T, N> &x)

Computes the batch of nearest integer values not greater in magnitude than scalars in x.

Return
the batch of nearest integer values not greater in magnitude than x.
Parameters
  • x: batch of floating point values.

template <class T, std::size_t N>
batch<T, N> xsimd::round(const batch<T, N> &x)

Computes the batch of nearest integer values to scalars in x (in floating point format), rounding halfway cases away from zero, regardless of the current rounding mode.

Return
the batch of nearest integer values.
Parameters
  • x: batch of flaoting point values.

template <class T, std::size_t N>
batch<T, N> xsimd::nearbyint(const batch<T, N> &x)

Rounds the scalars in x to integer values (in floating point format), using the current rounding mode.

Return
the batch of nearest integer values.
Parameters
  • x: batch of flaoting point values.

template <class T, std::size_t N>
batch<T, N> xsimd::rint(const batch<T, N> &x)

Rounds the scalars in x to integer values (in floating point format), using the current rounding mode.

Return
the batch of rounded values.
Parameters
  • x: batch of flaoting point values.