From c848ae14f2ef214be1d80600776ba1712196f0bf Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Wed, 3 Apr 2019 20:04:19 +0200 Subject: [PATCH] replaced pow(x, 2) with sqr(x) --- window.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/window.hh b/window.hh index bd9364c..65e4cb1 100644 --- a/window.hh +++ b/window.hh @@ -104,11 +104,15 @@ class Kaiser } return sum(); } + static TYPE sqr(TYPE x) + { + return x * x; + } public: Kaiser(TYPE a) : a(a) {} TYPE operator () (int n, int N) { - return i0(Const::Pi() * a * sqrt(TYPE(1) - pow(TYPE(2 * n) / TYPE(N - 1) - TYPE(1), TYPE(2)))) / i0(Const::Pi() * a); + return i0(Const::Pi() * a * sqrt(TYPE(1) - sqr(TYPE(2 * n) / TYPE(N - 1) - TYPE(1)))) / i0(Const::Pi() * a); } };