Nearest integer floating point operations

template<class B>
inline batch_type_t<B> xsimd::ceil(const simd_base<B> &x)

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

Parameters

x – batch of floating point values.

Returns

the batch of smallest integer values not less than x.

template<class B>
inline batch_type_t<B> xsimd::floor(const simd_base<B> &x)

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

Parameters

x – batch of floating point values.

Returns

the batch of largest integer values not greater than x.

template<class B>
inline batch_type_t<B> xsimd::trunc(const simd_base<B> &x)

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

Parameters

x – batch of floating point values.

Returns

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

template<class B>
inline batch_type_t<B> xsimd::round(const simd_base<B> &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.

Parameters

x – batch of flaoting point values.

Returns

the batch of nearest integer values.

template<class B>
inline batch_type_t<B> xsimd::nearbyint(const simd_base<B> &x)

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

Parameters

x – batch of flaoting point values.

Returns

the batch of nearest integer values.

template<class B>
inline batch_type_t<B> xsimd::rint(const simd_base<B> &x)

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

Parameters

x – batch of flaoting point values.

Returns

the batch of rounded values.