git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc43b7c)
Add an explicit cast to double when using fabs().
Tue, 5 Jan 2021 11:52:42 +0000 (11:52 +0000)
Tue, 5 Jan 2021 11:52:42 +0000 (11:52 +0000)
Commit bc43b7c2c0 used fabs() directly on an int variable, which
apparently requires an explicit cast on some platforms.

Per buildfarm.


diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 7cf56568f38a61434a75156e412786c03a303a1b..682200f636b9b17f417e79efe9df77bd19d7d8fc 100644 (file)
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -10290,7 +10290,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.
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /