maths: remove rootsquare, use std::hypot instead

This commit is contained in:
Danny Robson 2015-11-16 13:18:29 +11:00
parent b1bc54ac8c
commit 791f8b2bcd
3 changed files with 0 additions and 21 deletions

View File

@ -73,18 +73,6 @@ template uint32_t util::log2 (uint32_t);
template uint64_t util::log2 (uint64_t); template uint64_t util::log2 (uint64_t);
///////////////////////////////////////////////////////////////////////////////
template <typename T>
double
util::rootsquare (T a, T b)
{ return sqrt (util::pow2 (a) + util::pow2 (b)); }
//-----------------------------------------------------------------------------
template double util::rootsquare (double, double);
template double util::rootsquare ( int, int);
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
template <typename T> template <typename T>
bool bool

View File

@ -80,13 +80,6 @@ namespace util {
log2up (T val); log2up (T val);
///////////////////////////////////////////////////////////////////////////////
// Roots
template <typename T>
double
rootsquare (T a, T b);
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Rounding // Rounding
template <typename T, typename U> template <typename T, typename U>

View File

@ -143,8 +143,6 @@ main (void)
tap.expect_eq (util::pow2 (4u), 16u, "pow2"); tap.expect_eq (util::pow2 (4u), 16u, "pow2");
tap.expect_eq (util::rootsquare (2, 2), sqrt (8), "rootsquare");
static const double POS_ZERO = 1.0 / numeric_limits<double>::infinity (); static const double POS_ZERO = 1.0 / numeric_limits<double>::infinity ();
static const double NEG_ZERO = -1.0 / numeric_limits<double>::infinity (); static const double NEG_ZERO = -1.0 / numeric_limits<double>::infinity ();