Skip to content

Commit

Permalink
consistently use fabs
Browse files Browse the repository at this point in the history
  • Loading branch information
takenori-y committed Nov 15, 2022
1 parent d270c75 commit 74fe486
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/misc_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ bool MakePseudoQuadratureMirrorFilterBanks(
// Calculate error.
const double error(real[index] * real[index] + imag[index] * imag[index] -
0.5);
const double abs_error(std::abs(error));
const double abs_error(std::fabs(error));
if (abs_error < convergence_threshold) {
if (is_converged) *is_converged = true;
break;
Expand Down
4 changes: 2 additions & 2 deletions src/window/chebyshev_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "SPTK/window/chebyshev_window.h"

#include <cmath> // std::abs, std::acos, std::acosh, std::cos, std::cosh, std::pow
#include <cmath> // std::acos, std::acosh, std::cos, std::cosh, std::fabs, std::pow

namespace {

Expand All @@ -25,7 +25,7 @@ namespace {
*/
double T(double x, int n) {
double t;
if (std::abs(x) <= 1.0) {
if (std::fabs(x) <= 1.0) {
t = std::cos(n * std::acos(x));
} else if (1.0 < x) {
t = std::cosh(n * std::acosh(x));
Expand Down

0 comments on commit 74fe486

Please sign in to comment.