]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Add an explicit cast to double when using fabs().
authorDean Rasheed <dean.a.rasheed@gmail.com>
Tue, 5 Jan 2021 11:46:44 +0000 (11:46 +0000)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Tue, 5 Jan 2021 11:46:44 +0000 (11:46 +0000)
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

index 0bb2a7a9a3de49a169d9a03b8c45f65a4d0e4b89..f51820c5186ceab880f9d9f1f2d42c34b7f81444 100644 (file)
@@ -8265,7 +8265,7 @@ power_var_int(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.