Add an explicit cast to double when using fabs().
authorDean Rasheed
Tue, 5 Jan 2021 11:51:21 +0000 (11:51 +0000)
committerDean Rasheed
Tue, 5 Jan 2021 11:51:21 +0000 (11:51 +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 7582aa304329a1c459388b38f86a759a2729157d..7e47aa038e0ee8d97d8708683b818e724a92de9d 100644 (file)
@@ -9370,7 +9370,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.