diff --git a/main.c b/main.c index ff5c231e..ccc5f689 100644 --- a/main.c +++ b/main.c @@ -2105,8 +2105,12 @@ normalize_mpf(long sign, MPZ_Object *man, PyObject *exp, mp_bitcnt_t bc, switch (rnd) { case (Py_UCS4)'f': rnd = (Py_UCS4)(sign ? 'u' : 'd'); + break; case (Py_UCS4)'c': rnd = (Py_UCS4)(sign ? 'd' : 'u'); + break; + } + switch (rnd) { case (Py_UCS4)'d': res = MPZ_rshift1(man, shift); break; diff --git a/tests/conftest.py b/tests/conftest.py index c276a865..feaaaf04 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,4 @@ +import os from datetime import timedelta import gmp @@ -17,3 +18,7 @@ def pytest_report_header(config): Bits per limb: {gmp.gmp_info[0]} Size of a limb: {gmp.gmp_info[1]} """) + + +def pytest_sessionstart(session): + os.environ["MPMATH_NOGMPY"] = "Y"