◆ hypot
Callable object computing the hypot operation. Required header: Members Functions
Definition: value.hpp:103 Parameters
Return value The square root of the sum of the squared absolute values of the parameters. The result type is the common compatible type of the three parameters. auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::hypot Parameters
Return value A Callable object so that the expression Supported decorators
!!! Warning This is only available for floating point entries. ExampleSee it live on Compiler Explorer #include <eve/function/hypot.hpp>
#include <eve/function/pedantic/hypot.hpp>
#include <eve/constant/valmax.hpp>
#include <eve/wide.hpp>
#include <iomanip>
#include <iostream>
#include <cmath>
using wide_ft = eve::wide<float, eve::fixed<4>>;
int main()
{
wide_ft pf = {-1.0f, 2.0f, -3.0f, eve::valmax(eve::as<float>())/2};
wide_ft qf = {-4, 3, -2, -12};
std::cout << "---- simd" << std::setprecision(10) << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
double xf = -327680000;
double yf = 10;
std::cout << "---- scalar" << std::setprecision(15) << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
return 0;
}
constexpr callable_hypot_ hypot Callable object computing the hypot operation. Definition: hypot.hpp:94 constexpr callable_valmax_ valmax Callable object computing the greatest representable value. Definition: valmax.hpp:53 constexpr pedantic_type const pedantic Higher-order Callable Object imbuing more standard semantic onto other Callable Objects. Definition: pedantic.hpp:56 |