Skip to content

Commit

Permalink
Merge pull request #466 from skirpichev/misc
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
casevh authored Feb 6, 2024
2 parents 95a4ed2 + 2132a2d commit 5a9dfa9
Show file tree
Hide file tree
Showing 107 changed files with 255 additions and 297 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

# General information about the project.
project = gmpy2.__package__
copyright = '2012 - 2023, Case Van Horsen'
copyright = '2012 - 2024, Case Van Horsen'

gmpy2_version = packaging.version.parse(gmpy2.__version__)

Expand Down
40 changes: 20 additions & 20 deletions src/gmpy2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down Expand Up @@ -708,10 +708,10 @@ static PyMethodDef Pygmpy_methods [] =
{ "bit_scan1", (PyCFunction)GMPy_MPZ_bit_scan1_function, METH_FASTCALL, doc_bit_scan1_function },
{ "bit_set", GMPy_MPZ_bit_set_function, METH_VARARGS, doc_bit_set_function },
{ "bit_test", (PyCFunction)GMPy_MPZ_bit_test_function, METH_FASTCALL, doc_bit_test_function },
{ "bincoef", GMPy_MPZ_Function_Bincoef, METH_VARARGS, GMPy_doc_mpz_function_bincoef },
{ "bincoef", (PyCFunction)GMPy_MPZ_Function_Bincoef, METH_FASTCALL, GMPy_doc_mpz_function_bincoef },
{ "cmp", GMPy_MPANY_cmp, METH_VARARGS, GMPy_doc_mpany_cmp },
{ "cmp_abs", GMPy_MPANY_cmp_abs, METH_VARARGS, GMPy_doc_mpany_cmp_abs },
{ "comb", GMPy_MPZ_Function_Bincoef, METH_VARARGS, GMPy_doc_mpz_function_comb },
{ "comb", (PyCFunction)GMPy_MPZ_Function_Bincoef, METH_FASTCALL, GMPy_doc_mpz_function_comb },
{ "c_div", GMPy_MPZ_c_div, METH_VARARGS, doc_c_div },
{ "c_div_2exp", GMPy_MPZ_c_div_2exp, METH_VARARGS, doc_c_div_2exp },
{ "c_divmod", GMPy_MPZ_c_divmod, METH_VARARGS, doc_c_divmod },
Expand All @@ -721,8 +721,8 @@ static PyMethodDef Pygmpy_methods [] =
{ "denom", GMPy_MPQ_Function_Denom, METH_O, GMPy_doc_mpq_function_denom },
{ "digits", GMPy_Context_Digits, METH_VARARGS, GMPy_doc_context_digits },
{ "div", GMPy_Context_TrueDiv, METH_VARARGS, GMPy_doc_truediv },
{ "divexact", GMPy_MPZ_Function_Divexact, METH_VARARGS, GMPy_doc_mpz_function_divexact },
{ "divm", GMPy_MPZ_Function_Divm, METH_VARARGS, GMPy_doc_mpz_function_divm },
{ "divexact", (PyCFunction)GMPy_MPZ_Function_Divexact, METH_FASTCALL, GMPy_doc_mpz_function_divexact },
{ "divm", (PyCFunction)GMPy_MPZ_Function_Divm, METH_FASTCALL, GMPy_doc_mpz_function_divm },
{ "double_fac", GMPy_MPZ_Function_DoubleFac, METH_O, GMPy_doc_mpz_function_double_fac },
{ "fac", GMPy_MPZ_Function_Fac, METH_O, GMPy_doc_mpz_function_fac },
{ "fib", GMPy_MPZ_Function_Fib, METH_O, GMPy_doc_mpz_function_fib },
Expand All @@ -736,16 +736,16 @@ static PyMethodDef Pygmpy_methods [] =
{ "f_mod", GMPy_MPZ_f_mod, METH_VARARGS, doc_f_mod },
{ "f_mod_2exp", GMPy_MPZ_f_mod_2exp, METH_VARARGS, doc_f_mod_2exp },
{ "gcd", (PyCFunction)GMPy_MPZ_Function_GCD, METH_FASTCALL, GMPy_doc_mpz_function_gcd },
{ "gcdext", GMPy_MPZ_Function_GCDext, METH_VARARGS, GMPy_doc_mpz_function_gcdext },
{ "gcdext", (PyCFunction)GMPy_MPZ_Function_GCDext, METH_FASTCALL, GMPy_doc_mpz_function_gcdext },
{ "hamdist", GMPy_MPZ_hamdist, METH_VARARGS, doc_hamdist },
{ "invert", GMPy_MPZ_Function_Invert, METH_VARARGS, GMPy_doc_mpz_function_invert },
{ "iroot", GMPy_MPZ_Function_Iroot, METH_VARARGS, GMPy_doc_mpz_function_iroot },
{ "iroot_rem", GMPy_MPZ_Function_IrootRem, METH_VARARGS, GMPy_doc_mpz_function_iroot_rem },
{ "invert", (PyCFunction)GMPy_MPZ_Function_Invert, METH_FASTCALL, GMPy_doc_mpz_function_invert },
{ "iroot", (PyCFunction)GMPy_MPZ_Function_Iroot, METH_FASTCALL, GMPy_doc_mpz_function_iroot },
{ "iroot_rem", (PyCFunction)GMPy_MPZ_Function_IrootRem, METH_FASTCALL, GMPy_doc_mpz_function_iroot_rem },
{ "isqrt", GMPy_MPZ_Function_Isqrt, METH_O, GMPy_doc_mpz_function_isqrt },
{ "isqrt_rem", GMPy_MPZ_Function_IsqrtRem, METH_O, GMPy_doc_mpz_function_isqrt_rem },
{ "is_bpsw_prp", GMPY_mpz_is_bpsw_prp, METH_VARARGS, doc_mpz_is_bpsw_prp },
{ "is_congruent", GMPy_MPZ_Function_IsCongruent, METH_VARARGS, GMPy_doc_mpz_function_is_congruent },
{ "is_divisible", GMPy_MPZ_Function_IsDivisible, METH_VARARGS, GMPy_doc_mpz_function_is_divisible },
{ "is_congruent", (PyCFunction)GMPy_MPZ_Function_IsCongruent, METH_FASTCALL, GMPy_doc_mpz_function_is_congruent },
{ "is_divisible", (PyCFunction)GMPy_MPZ_Function_IsDivisible, METH_FASTCALL, GMPy_doc_mpz_function_is_divisible },
{ "is_even", GMPy_MPZ_Function_IsEven, METH_O, GMPy_doc_mpz_function_is_even },
{ "is_euler_prp", GMPY_mpz_is_euler_prp, METH_VARARGS, doc_mpz_is_euler_prp },
{ "is_extra_strong_lucas_prp", GMPY_mpz_is_extrastronglucas_prp, METH_VARARGS, doc_mpz_is_extrastronglucas_prp },
Expand All @@ -754,18 +754,18 @@ static PyMethodDef Pygmpy_methods [] =
{ "is_lucas_prp", GMPY_mpz_is_lucas_prp, METH_VARARGS, doc_mpz_is_lucas_prp },
{ "is_odd", GMPy_MPZ_Function_IsOdd, METH_O, GMPy_doc_mpz_function_is_odd },
{ "is_power", GMPy_MPZ_Function_IsPower, METH_O, GMPy_doc_mpz_function_is_power },
{ "is_prime", GMPy_MPZ_Function_IsPrime, METH_VARARGS, GMPy_doc_mpz_function_is_prime },
{ "is_prime", (PyCFunction)GMPy_MPZ_Function_IsPrime, METH_FASTCALL, GMPy_doc_mpz_function_is_prime },
{ "is_probab_prime", (PyCFunction)GMPy_MPZ_Function_IsProbabPrime, METH_FASTCALL, GMPy_doc_mpz_function_is_probab_prime },
{ "is_selfridge_prp", GMPY_mpz_is_selfridge_prp, METH_VARARGS, doc_mpz_is_selfridge_prp },
{ "is_square", GMPy_MPZ_Function_IsSquare, METH_O, GMPy_doc_mpz_function_is_square },
{ "is_strong_prp", GMPY_mpz_is_strong_prp, METH_VARARGS, doc_mpz_is_strong_prp },
{ "is_strong_bpsw_prp", GMPY_mpz_is_strongbpsw_prp, METH_VARARGS, doc_mpz_is_strongbpsw_prp },
{ "is_strong_lucas_prp", GMPY_mpz_is_stronglucas_prp, METH_VARARGS, doc_mpz_is_stronglucas_prp },
{ "is_strong_selfridge_prp", GMPY_mpz_is_strongselfridge_prp, METH_VARARGS, doc_mpz_is_strongselfridge_prp },
{ "jacobi", GMPy_MPZ_Function_Jacobi, METH_VARARGS, GMPy_doc_mpz_function_jacobi },
{ "kronecker", GMPy_MPZ_Function_Kronecker, METH_VARARGS, GMPy_doc_mpz_function_kronecker },
{ "jacobi", (PyCFunction)GMPy_MPZ_Function_Jacobi, METH_FASTCALL, GMPy_doc_mpz_function_jacobi },
{ "kronecker", (PyCFunction)GMPy_MPZ_Function_Kronecker, METH_FASTCALL, GMPy_doc_mpz_function_kronecker },
{ "lcm", (PyCFunction)GMPy_MPZ_Function_LCM, METH_FASTCALL, GMPy_doc_mpz_function_lcm },
{ "legendre", GMPy_MPZ_Function_Legendre, METH_VARARGS, GMPy_doc_mpz_function_legendre },
{ "legendre", (PyCFunction)GMPy_MPZ_Function_Legendre, METH_FASTCALL, GMPy_doc_mpz_function_legendre },
{ "license", GMPy_get_license, METH_NOARGS, GMPy_doc_license },
{ "lucas", GMPy_MPZ_Function_Lucas, METH_O, GMPy_doc_mpz_function_lucas },
{ "lucasu", GMPY_mpz_lucasu, METH_VARARGS, doc_mpz_lucasu },
Expand All @@ -784,13 +784,13 @@ static PyMethodDef Pygmpy_methods [] =
{ "mpz_rrandomb", GMPy_MPZ_rrandomb_Function, METH_VARARGS, GMPy_doc_mpz_rrandomb_function },
{ "mpz_urandomb", GMPy_MPZ_urandomb_Function, METH_VARARGS, GMPy_doc_mpz_urandomb_function },
{ "mul", GMPy_Context_Mul, METH_VARARGS, GMPy_doc_function_mul },
{ "multi_fac", GMPy_MPZ_Function_MultiFac, METH_VARARGS, GMPy_doc_mpz_function_multi_fac },
{ "multi_fac", (PyCFunction)GMPy_MPZ_Function_MultiFac, METH_FASTCALL, GMPy_doc_mpz_function_multi_fac },
{ "next_prime", GMPy_MPZ_Function_NextPrime, METH_O, GMPy_doc_mpz_function_next_prime },
#if (__GNU_MP_VERSION > 6) || (__GNU_MP_VERSION == 6 && __GNU_MP_VERSION_MINOR >= 3)
{ "prev_prime", GMPy_MPZ_Function_PrevPrime, METH_O, GMPy_doc_mpz_function_prev_prime },
#endif
{ "numer", GMPy_MPQ_Function_Numer, METH_O, GMPy_doc_mpq_function_numer },
{ "num_digits", GMPy_MPZ_Function_NumDigits, METH_VARARGS, GMPy_doc_mpz_function_num_digits },
{ "num_digits", (PyCFunction)GMPy_MPZ_Function_NumDigits, METH_FASTCALL, GMPy_doc_mpz_function_num_digits },
{ "pack", GMPy_MPZ_pack, METH_VARARGS, doc_pack },
{ "popcount", GMPy_MPZ_popcount, METH_O, doc_popcount },
{ "powmod", GMPy_Integer_PowMod, METH_VARARGS, GMPy_doc_integer_powmod },
Expand All @@ -799,7 +799,7 @@ static PyMethodDef Pygmpy_methods [] =
{ "powmod_sec", GMPy_Integer_PowMod_Sec, METH_VARARGS, GMPy_doc_integer_powmod_sec },
{ "primorial", GMPy_MPZ_Function_Primorial, METH_O, GMPy_doc_mpz_function_primorial },
{ "qdiv", GMPy_MPQ_Function_Qdiv, METH_VARARGS, GMPy_doc_function_qdiv },
{ "remove", GMPy_MPZ_Function_Remove, METH_VARARGS, GMPy_doc_mpz_function_remove },
{ "remove", (PyCFunction)GMPy_MPZ_Function_Remove, METH_FASTCALL, GMPy_doc_mpz_function_remove },
{ "random_state", GMPy_RandomState_Factory, METH_VARARGS, GMPy_doc_random_state_factory },
{ "sign", GMPy_Context_Sign, METH_O, GMPy_doc_function_sign },
{ "square", GMPy_Context_Square, METH_O, GMPy_doc_function_square },
Expand All @@ -814,8 +814,8 @@ static PyMethodDef Pygmpy_methods [] =
{ "unpack", GMPy_MPZ_unpack, METH_VARARGS, doc_unpack },
{ "version", GMPy_get_version, METH_NOARGS, GMPy_doc_version },
{ "xbit_mask", GMPy_XMPZ_Function_XbitMask, METH_O, GMPy_doc_xmpz_function_xbit_mask },
{ "_mpmath_normalize", (PyCFunction)(void(*)(void))Pympz_mpmath_normalize_fast, METH_FASTCALL, doc_mpmath_normalizeg },
{ "_mpmath_create", (PyCFunction)(void(*)(void))Pympz_mpmath_create_fast, METH_FASTCALL, doc_mpmath_create },
{ "_mpmath_normalize", (PyCFunction)Pympz_mpmath_normalize_fast, METH_FASTCALL, doc_mpmath_normalizeg },
{ "_mpmath_create", (PyCFunction)Pympz_mpmath_create_fast, METH_FASTCALL, doc_mpmath_create },

{ "acos", GMPy_Context_Acos, METH_O, GMPy_doc_function_acos },
{ "acosh", GMPy_Context_Acosh, METH_O, GMPy_doc_function_acosh },
Expand Down
6 changes: 1 addition & 5 deletions src/gmpy2.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down Expand Up @@ -71,10 +71,6 @@ extern "C" {
# error "GMPY2 requires Python 3.7 or later."
#endif

#if PY_VERSION_HEX < 0x03080000
# define PyVectorcall_NARGS(n) (n)
#endif

/* Include headers for GMP, MPFR, and MPC. */

#include <gmp.h>
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_abs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_abs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_add.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_binary.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_cmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_const.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* *
* Copyright 2000 - 2009 Alex Martelli *
* *
* Copyright 2008 - 2023 Case Van Horsen *
* Copyright 2008 - 2024 Case Van Horsen *
* *
* This file is part of GMPY2. *
* *
Expand Down
Loading

0 comments on commit 5a9dfa9

Please sign in to comment.