From 791f8b2bcd12bc1aff0456559ea8097fe3362054 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 16 Nov 2015 13:18:29 +1100 Subject: [PATCH] maths: remove rootsquare, use std::hypot instead --- maths.cpp | 12 ------------ maths.hpp | 7 ------- test/maths.cpp | 2 -- 3 files changed, 21 deletions(-) diff --git a/maths.cpp b/maths.cpp index 4c7fe55e..8891d707 100644 --- a/maths.cpp +++ b/maths.cpp @@ -73,18 +73,6 @@ template uint32_t util::log2 (uint32_t); template uint64_t util::log2 (uint64_t); -/////////////////////////////////////////////////////////////////////////////// -template -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 bool diff --git a/maths.hpp b/maths.hpp index d9f0a7f6..3f01979f 100644 --- a/maths.hpp +++ b/maths.hpp @@ -80,13 +80,6 @@ namespace util { log2up (T val); - /////////////////////////////////////////////////////////////////////////////// - // Roots - template - double - rootsquare (T a, T b); - - /////////////////////////////////////////////////////////////////////////////// // Rounding template diff --git a/test/maths.cpp b/test/maths.cpp index 6d449bc3..24077983 100644 --- a/test/maths.cpp +++ b/test/maths.cpp @@ -143,8 +143,6 @@ main (void) 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::infinity (); static const double NEG_ZERO = -1.0 / numeric_limits::infinity ();