1 #include "catch2/catch.hpp" 12 CHECK(
hypot(5, 12) == 13);
13 CHECK(
hypot(.5, 1.2) == Approx(1.3).epsilon(0.0001));
14 CHECK(
hypot(.05L, .12L) == Approx(.13L).epsilon(0.0001L));
19 CHECK(std::isnan(
hypot(std::numeric_limits<double>::quiet_NaN(), 1.2)));
20 CHECK(std::isnan(
hypot(3.1415926, std::numeric_limits<double>::quiet_NaN())));
25 CHECK(std::isinf(
hypot(std::numeric_limits<double>::infinity(), 1.2)));
26 CHECK(std::isinf(
hypot(3.1415926, std::numeric_limits<double>::infinity())));
28 CHECK(std::isinf(
hypot(-std::numeric_limits<double>::infinity(), 1.2)));
29 CHECK(std::isinf(
hypot(3.1415926, -std::numeric_limits<double>::infinity())));
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)