#include "catch2/catch.hpp"
#include <cmath>
#include <limits>
#include "cetlib/hypot.h"
Go to the source code of this file.
TEST_CASE |
( |
"Basic test" |
| ) |
|
Definition at line 10 of file hypot_test.cc.
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));
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
Definition at line 17 of file hypot_test.cc.
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())));
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
Definition at line 23 of file hypot_test.cc.
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)