From 3eb2783cdf85688e7babef7b912cd02210901cfe Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Mon, 1 Feb 2021 11:25:23 +0800 Subject: [PATCH] Use abs, not fabs, on integer types --- dsp/helpers/tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsp/helpers/tables.c b/dsp/helpers/tables.c index fe0bc8f..1ab7ecc 100644 --- a/dsp/helpers/tables.c +++ b/dsp/helpers/tables.c @@ -86,8 +86,8 @@ const uint16_t * get_sc16q11_mag_12bit_table() for (int q = -2048; q <= 2047; q++) { float fI, fQ, magsq; - fI = fabs(i) / 2048.0; - fQ = fabs(q) / 2048.0; + fI = abs(i) / 2048.0; + fQ = abs(q) / 2048.0; magsq = fI * fI + fQ * fQ; float mag = round(sqrtf(magsq) * 65536.0f);