Skip to content

Commit

Permalink
Merge pull request #422 from skirpichev/mpfr-4.2.1
Browse files Browse the repository at this point in the history
Update MPFR to 4.2.1 in build scripts & fix test failures on new version
  • Loading branch information
casevh authored Sep 5, 2023
2 parents 016dc98 + 68a6b48 commit e419efa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/before_ci_build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e -x

GMP_VERSION=6.2.1
MPFR_VERSION=4.1.1
MPFR_VERSION=4.2.1
MPC_VERSION=1.2.1
if [ ! -f finish_before_ci_build ]; then
if [[ "$OSTYPE" == "linux-gnu" || "$OSTYPE" == "linux-musl" || "$OSTYPE" == "darwin"* ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/before_ci_build_apple_silicon.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e -x

GMP_VERSION=6.2.1
MPFR_VERSION=4.1.1
MPFR_VERSION=4.2.1
MPC_VERSION=1.2.1
export CPPFLAGS=" --target=arm64-apple-macos11"
export LDFLAGS=" -arch arm64"
Expand Down
2 changes: 2 additions & 0 deletions src/gmpy2_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,14 @@ GMPy_MPC_Format(PyObject *self, PyObject *args)
if (mpcstyle)
strcat(tempbuf, " ");
else {
#if MPFR_VERSION < MPFR_VERSION_NUM(4,2,1)
/* Need to insert + if imag is nan or +inf. */
if (mpfr_nan_p(mpc_imagref(MPC(self))) ||
(mpfr_inf_p(mpc_imagref(MPC(self))) &&
mpfr_sgn(mpc_imagref(MPC(self))) > 0)) {
strcat(tempbuf, "+");
}
#endif
}
strcat(tempbuf, imagbuf);
if (strlen(imagbuf) < 50 &&
Expand Down

0 comments on commit e419efa

Please sign in to comment.