Nearest integer floating point operations

template<class T, class A>
inline batch<T, A> xsimd::ceil(batch<T, A> const &x) noexcept

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 T, class A>
inline batch<T, A> xsimd::floor(batch<T, A> const &x) noexcept

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 T, class A>
inline batch<T, A> xsimd::trunc(batch<T, A> const &x) noexcept

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 T, class A>
inline batch<T, A> xsimd::round(batch<T, A> const &x) noexcept

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 T, class A>
inline batch<T, A> xsimd::nearbyint(batch<T, A> const &x) noexcept

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

Parameters

x – batch of floating point values.

Returns

the batch of nearest integer values.

template<class T, class A>
inline batch<T, A> xsimd::rint(batch<T, A> const &x) noexcept

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

Parameters

x – batch of floating point values.

Returns

the batch of rounded values.