From f14aad5169baa5e2ac25d49f1d18f9d5cb3bc7f2 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 7 Oct 2022 13:28:38 +0200 Subject: Remove unnecessary uses of Abs() Use C standard abs() or fabs() instead. Reviewed-by: Zhang Mingli Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/4beb42b5-216b-bce8-d452-d924d5794c63%40enterprisedb.com --- src/backend/utils/adt/timestamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/timestamp.c') diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 9799647e1a5..d8552a1f186 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -3290,7 +3290,7 @@ interval_mul(PG_FUNCTION_ARGS) * cascade from months and days. It might still be >24 if the combination * of cascade and the seconds factor operation itself. */ - if (Abs(sec_remainder) >= SECS_PER_DAY) + if (fabs(sec_remainder) >= SECS_PER_DAY) { result->day += (int) (sec_remainder / SECS_PER_DAY); sec_remainder -= (int) (sec_remainder / SECS_PER_DAY) * SECS_PER_DAY; @@ -3347,7 +3347,7 @@ interval_div(PG_FUNCTION_ARGS) sec_remainder = (orig_day / factor - result->day + month_remainder_days - (int) month_remainder_days) * SECS_PER_DAY; sec_remainder = TSROUND(sec_remainder); - if (Abs(sec_remainder) >= SECS_PER_DAY) + if (fabs(sec_remainder) >= SECS_PER_DAY) { result->day += (int) (sec_remainder / SECS_PER_DAY); sec_remainder -= (int) (sec_remainder / SECS_PER_DAY) * SECS_PER_DAY; -- cgit v1.2.3