postgres.git / summary / log / commit / refs
commit ab042d0108232d4b8b6a2b104a466a4bb2f6b9f1
Author: Dean Rasheed <dean.a.rasheed@gmail.com>
Date: Tue Jan 05 11:48:45 2021 +0000
First released in: 14.0, 9.6.21, 10.16, 11.11, 12.6, 13.2
Add an explicit cast to double when using fabs().
Commit bc43b7c2c0 used fabs() directly on an int variable, which
apparently requires an explicit cast on some platforms.
Per buildfarm.
src/backend/utils/adt/numeric.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 67fbf20a9d2..fbfae79c355 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -8433,7 +8433,7 @@ power_var_int(const NumericVar *base, int exp, NumericVar *result, int rscale)
* to around log10(abs(exp)) digits, so work with this many extra digits
* of precision (plus a few more for good measure).
*/
- sig_digits += (int) log(fabs(exp)) + 8;
+ sig_digits += (int) log(fabs((double) exp)) + 8;
/*
* Now we can proceed with the multiplications.
[parent: 160a9e425f18]