◆ round
Callable object computing the round operation. Required header: Members Functions
template< value T > auto operator()( T x ) const noexcept;
Parameters
Return value Computes elementwise the integer nearest to If The call to auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::round Parameters
Return value A Callable object so that the expression Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/round.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float, eve::fixed<8>>;
int main()
{
wide_ft pf = {-1.0f, -1.3f, -1.5f, -1.7f, 2.0f, 2.3f, 2.5f, 2.7f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
float xf = -32.768f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
return 0;
}
constexpr toward_zero_type const toward_zero Higher-order Callable Object imbuing rounding toward zero semantic onto other Callable Objects. Definition: roundings.hpp:163 constexpr upward_type const upward Higher-order Callable Object imbuing upward rounding semantic onto other Callable Objects. Definition: roundings.hpp:160 constexpr downward_type const downward Higher-order Callable Object imbuing rounding downard semantic onto other Callable Objects. Definition: roundings.hpp:161 constexpr to_nearest_type const to_nearest Higher-order Callable Object imbuing rounding to nearest semantic onto other Callable Objects. Definition: roundings.hpp:162 constexpr callable_round_ round Callable object computing the round operation. Definition: round.hpp:96 |