Nearest integer floating point operations

xtensor provides the following rounding operations for xexpressions:

Defined in xtensor/xmath.hpp

template<class E>
auto xt::ceil(E &&e)

ceil function.

Returns an xfunction for the element-wise smallest integer value not less than e.

Return

an xfunction

Parameters

template<class E>
auto xt::floor(E &&e)

floor function.

Returns an xfunction for the element-wise smallest integer value not greater than e.

Return

an xfunction

Parameters

template<class E>
auto xt::trunc(E &&e)

trunc function.

Returns an xfunction for the element-wise nearest integer not greater in magnitude than e.

Return

an xfunction

Parameters

template<class E>
auto xt::round(E &&e)

round function.

Returns an xfunction for the element-wise nearest integer value to e, rounding halfway cases away from zero, regardless of the current rounding mode.

Return

an xfunction

Parameters

template<class E>
auto xt::nearbyint(E &&e)

nearbyint function.

Returns an xfunction for the element-wise rounding of e to integer values in floating point format, using the current rounding mode. nearbyint never raises FE_INEXACT error.

Return

an xfunction

Parameters

template<class E>
auto xt::rint(E &&e)

rint function.

Returns an xfunction for the element-wise rounding of e to integer values in floating point format, using the current rounding mode. Contrary to nearbyint, rint may raise FE_INEXACT error.

Return

an xfunction

Parameters