MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / hypot

Method hypot

extern/half/include/half.hpp:1464–1472  ·  view source on GitHub ↗

Hypotenuse implementation. \param x first argument \param y second argument \return function value stored in single-preicision

Source from the content-addressed store, hash-verified

1462 /// \param y second argument
1463 /// \return function value stored in single-preicision
1464 static expr hypot(float x, float y)
1465 {
1466 #if HALF_ENABLE_CPP11_CMATH
1467 return expr(std::hypot(x, y));
1468 #else
1469 return expr((builtin_isinf(x) || builtin_isinf(y)) ? std::numeric_limits<float>::infinity() :
1470 static_cast<float>(std::sqrt(static_cast<double>(x)*x+static_cast<double>(y)*y)));
1471 #endif
1472 }
1473
1474 /// Power implementation.
1475 /// \param base value to exponentiate

Callers

nothing calls this directly

Calls 5

exprClass · 0.85
hypotFunction · 0.85
builtin_isinfFunction · 0.85
infinityFunction · 0.85
sqrtFunction · 0.85

Tested by

no test coverage detected