--- /srv/rebuilderd/tmp/rebuilderd7gY6ub/inputs/python-gmpy2-common_2.2.1-2_all.deb +++ /srv/rebuilderd/tmp/rebuilderd7gY6ub/out/python-gmpy2-common_2.2.1-2_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2024-09-13 02:08:43.000000 debian-binary │ -rw-r--r-- 0 0 0 808 2024-09-13 02:08:43.000000 control.tar.xz │ --rw-r--r-- 0 0 0 41888 2024-09-13 02:08:43.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 40376 2024-09-13 02:08:43.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./control │ │ │ @@ -1,13 +1,13 @@ │ │ │ Package: python-gmpy2-common │ │ │ Source: python-gmpy2 │ │ │ Version: 2.2.1-2 │ │ │ Architecture: all │ │ │ Maintainer: Martin Kelly │ │ │ -Installed-Size: 53 │ │ │ +Installed-Size: 52 │ │ │ Recommends: python3-gmpy2 │ │ │ Section: python │ │ │ Priority: optional │ │ │ Multi-Arch: foreign │ │ │ Homepage: https://github.com/aleaxit/gmpy │ │ │ Description: common files for python3-gmpy2 │ │ │ gmpy is a C-coded Python extension module that wraps the GMP library to │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -7,8 +7,8 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 8170 2024-07-19 06:31:02.000000 ./usr/share/doc/python-gmpy2-common/changelog.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 1178 2024-08-31 21:55:34.000000 ./usr/share/doc/python-gmpy2-common/copyright │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-09-13 02:08:43.000000 ./usr/share/lintian/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-09-13 02:08:43.000000 ./usr/share/lintian/overrides/ │ │ │ -rw-r--r-- 0 root (0) root (0) 120 2024-08-31 21:55:34.000000 ./usr/share/lintian/overrides/python-gmpy2-common │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-09-13 02:08:43.000000 ./usr/share/man/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2024-09-13 02:08:43.000000 ./usr/share/man/man3/ │ │ │ --rw-r--r-- 0 root (0) root (0) 30630 2024-09-13 02:08:43.000000 ./usr/share/man/man3/gmpy2.3.gz │ │ │ +-rw-r--r-- 0 root (0) root (0) 29123 2024-09-13 02:08:43.000000 ./usr/share/man/man3/gmpy2.3.gz │ │ ├── ./usr/share/man/man3/gmpy2.3.gz │ │ │ ├── gmpy2.3 │ │ │ │ @@ -60,15 +60,15 @@ │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .SH CONTENTS │ │ │ │ .SS Overview │ │ │ │ .sp │ │ │ │ The \fI\%mpz\fP and \fI\%mpq\fP types support arbitrary precision integers and rationals │ │ │ │ via the GMP library. These types should be drop\-in replacements for Python\(aqs │ │ │ │ -\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'\(aqs and \X'tty: link https://docs.python.org/3/library/fractions.html#fractions.Fraction'\fI\%Fraction\fP\X'tty: link'\(aqs, but are significantly faster for large │ │ │ │ +\fBint\fP\(aqs and \fBFraction\fP\(aqs, but are significantly faster for large │ │ │ │ values. The cutover point for performance varies, but can be as low as 20 to │ │ │ │ 40 digits. All the special integer functions in the GMP are supported. │ │ │ │ .sp │ │ │ │ \fBWARNING:\fP │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ gmpy2 can crash the Python interpreter in case of memory allocation │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │ .sp │ │ │ │ The \fI\%mpfr\fP and \fI\%mpc\fP types provide support for correctly rounded multiple │ │ │ │ precision real and complex arithmetic via the MPFR and MPC libraries. The │ │ │ │ \fI\%context\fP type is used to control precision, rounding modes, and exceptional │ │ │ │ conditions. For example, division by zero can either return an Infinity or │ │ │ │ raise an exception. It is possible to specify different precision and rounding │ │ │ │ modes for both the real and imaginary components of an \fI\%mpc\fP\&. The default │ │ │ │ -precision is 53 bits \-\-\- just same as for Python\(aqs \X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link' and \X'tty: link https://docs.python.org/3/library/functions.html#complex'\fI\%complex\fP\X'tty: link' types. │ │ │ │ +precision is 53 bits \-\-\- just same as for Python\(aqs \fBfloat\fP and \fBcomplex\fP types. │ │ │ │ .sp │ │ │ │ Operator overloading is fully supported. Coversion from native Python types is │ │ │ │ optimized for performance. │ │ │ │ .SS Installation │ │ │ │ .sp │ │ │ │ gmpy2 requires CPython 3.7 or above. Pre\-compiled binary wheels are available │ │ │ │ on PyPI. You can install latest release with pip: │ │ │ │ @@ -285,15 +285,15 @@ │ │ │ │ True │ │ │ │ .EE │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .sp │ │ │ │ Exceptions are normally raised in Python when the result of a real operation is │ │ │ │ not defined over the reals; for example, \fBmath.sqrt(\-2)\fP will raise a │ │ │ │ -\X'tty: link https://docs.python.org/3/library/exceptions.html#ValueError'\fI\%ValueError\fP\X'tty: link' exception. The default context in gmpy2 implements similar │ │ │ │ +\fBValueError\fP exception. The default context in gmpy2 implements similar │ │ │ │ behavior, but by setting \fI\%allow_complex\fP flag, complex results │ │ │ │ will be returned. │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ .sp │ │ │ │ .EX │ │ │ │ >>> sqrt(mpfr(\-2)) │ │ │ │ @@ -302,15 +302,15 @@ │ │ │ │ >>> sqrt(mpfr(\-2)) │ │ │ │ mpc(\(aq0.0+1.4142135623730951j\(aq) │ │ │ │ .EE │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .sp │ │ │ │ Contexts can also be used as context managers in conjunction with Python\(aqs │ │ │ │ -\X'tty: link https://docs.python.org/3/reference/compound_stmts.html#with'\fI\%with\fP\X'tty: link' statement to temporarily change the current context settings │ │ │ │ +\fBwith\fP statement to temporarily change the current context settings │ │ │ │ for a block of code. │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ .sp │ │ │ │ .EX │ │ │ │ >>> print(const_pi()) │ │ │ │ 3.1415926535897931 │ │ │ │ @@ -340,15 +340,15 @@ │ │ │ │ mpc(\(aq1.272019649514068965+0.78615137775742328606947j\(aq,(60,70)) │ │ │ │ .EE │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .sp │ │ │ │ All gmpy2 numeric types support Python\(aqs \(dqnew style\(dq string formatting │ │ │ │ available in \X'tty: link https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings'\fI\%formatted string literals\fP\X'tty: link' or with │ │ │ │ -\X'tty: link https://docs.python.org/3/library/stdtypes.html#str.format'\fI\%str.format()\fP\X'tty: link'; see \X'tty: link https://docs.python.org/3/library/string.html#formatspec'\fI\%Format Specification Mini\-Language\fP\X'tty: link' for a description │ │ │ │ +\fBstr.format()\fP; see \X'tty: link https://docs.python.org/3/library/string.html#formatspec'\fI\%Format Specification Mini\-Language\fP\X'tty: link' for a description │ │ │ │ of the standard formatting syntax. The precision value optionally can be │ │ │ │ followed by the rounding mode type (\(aqU\(aq to round toward plus infinity, \(aqD\(aq to │ │ │ │ round toward minus infinity, \(aqY\(aq to round away from zero, \(aqZ\(aq to round toward │ │ │ │ zero and \(aqN\(aq \- round to the nearest value. │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ .sp │ │ │ │ @@ -372,26 +372,26 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B class gmpy2.mpz(n=0, /) │ │ │ │ .TP │ │ │ │ .B class gmpy2.mpz(s, /, base=0) │ │ │ │ Return an immutable integer constructed from a numeric value n (truncating │ │ │ │ n to its integer part) or a string s made of digits in the given base. │ │ │ │ -Every input, that is accepted by the \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' type constructor is also accepted. │ │ │ │ +Every input, that is accepted by the \fBint\fP type constructor is also accepted. │ │ │ │ .sp │ │ │ │ The base may vary from 2 to 62, or if base is 0, then binary, octal, or │ │ │ │ hexadecimal strings are recognized by leading \(aq0b\(aq, \(aq0o\(aq, or \(aq0x\(aq │ │ │ │ characters (case is ignored), otherwise the string is assumed to be │ │ │ │ decimal. For bases up to 36, digits case is ignored. For bases 37 │ │ │ │ to 62, upper\-case letter represent the usual 10..35 range, while │ │ │ │ lower\-case letter represent 36..61. Optionally the string can be │ │ │ │ preceded by \(aq+\(aq or \(aq\-\(aq. White space and underscore is simply ignored. │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B __format__(fmt) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B __format__(fmt) -> str │ │ │ │ Return a Python string by formatting \fI\%mpz\fP \(aqx\(aq using the format string │ │ │ │ \(aqfmt\(aq. A valid format string consists of: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ optional alignment code: │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ @@ -432,75 +432,75 @@ │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .sp │ │ │ │ The default format is \(aqd\(aq. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B as_integer_ratio() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B as_integer_ratio() -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return a pair of integers, whose ratio is exactly equal to the │ │ │ │ original number. The ratio is in lowest terms and has a │ │ │ │ positive denominator. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B bit_clear(n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit cleared. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_count() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B bit_count() -> int │ │ │ │ Return the number of 1\-bits set in abs(x). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B bit_flip(n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit inverted. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_length() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B bit_length() -> int │ │ │ │ Return the number of significant bits in the radix\-2 │ │ │ │ representation of x. Note: mpz(0).bit_length() returns 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_scan0(n=0, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B bit_scan0(n=0, /) -> int | None │ │ │ │ Return the index of the first 0\-bit of x with index >= n. n >= 0. │ │ │ │ If there are no more 0\-bits in x at or above index n (which can │ │ │ │ only happen for x<0, assuming an infinitely long 2\(aqs complement │ │ │ │ -format), then \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' is returned. │ │ │ │ +format), then \fBNone\fP is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_scan1(n=0, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B bit_scan1(n=0, /) -> int | None │ │ │ │ Return the index of the first 1\-bit of x with index >= n. n >= 0. │ │ │ │ If there are no more 1\-bits in x at or above index n (which can │ │ │ │ only happen for x>=0, assuming an infinitely long 2\(aqs complement │ │ │ │ -format), then \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' is returned. │ │ │ │ +format), then \fBNone\fP is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B bit_set(n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_test(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ +.B bit_test(n, /) -> bool │ │ │ │ Return the value of the n\-th bit of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B conjugate() -> \fI\%mpz\fP │ │ │ │ Return the conjugate of x (which is just a new reference to x since x is │ │ │ │ not a complex number). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B digits(base=10, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B digits(base=10, /) -> str │ │ │ │ Return Python string representing x in the given base. Values for │ │ │ │ base can range between 2 to 62. A leading \(aq\-\(aq is present if x<0 │ │ │ │ but no leading \(aq+\(aq is present if x>=0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B from_bytes(bytes, byteorder=\(aqbig\(aq, *, signed=False) -> \fI\%mpz\fP │ │ │ │ @@ -508,106 +508,106 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B bytes │ │ │ │ Holds the array of bytes to convert. The argument must either │ │ │ │ support the buffer protocol or be an iterable object producing bytes. │ │ │ │ -\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' and \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytearray'\fI\%bytearray\fP\X'tty: link' are examples of built\-in objects that support │ │ │ │ +\fBbytes\fP and \fBbytearray\fP are examples of built\-in objects that support │ │ │ │ the buffer protocol. │ │ │ │ .TP │ │ │ │ .B byteorder │ │ │ │ The byte order used to represent the integer. If byteorder is \(aqbig\(aq, │ │ │ │ the most significant byte is at the beginning of the byte array. If │ │ │ │ byteorder is \(aqlittle\(aq, the most significant byte is at the end of the │ │ │ │ byte array. To request the native byte order of the host system, use │ │ │ │ -\X'tty: link https://docs.python.org/3/library/sys.html#sys.byteorder'\fI\%sys.byteorder\fP\X'tty: link' as the byte order value. │ │ │ │ +\fBsys.byteorder\fP as the byte order value. │ │ │ │ .TP │ │ │ │ .B signed │ │ │ │ Indicates whether two\(aqs complement is used to represent the integer. │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_congruent(y, m, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Returns \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is congruent to y modulo m, else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_congruent(y, m, /) -> bool │ │ │ │ +Returns \fBTrue\fP if x is congruent to y modulo m, else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_divisible(d, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Returns \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is divisible by d, else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_divisible(d, /) -> bool │ │ │ │ +Returns \fBTrue\fP if x is divisible by d, else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_even() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is even, \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B is_even() -> bool │ │ │ │ +Return \fBTrue\fP if x is even, \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_odd() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is odd, \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B is_odd() -> bool │ │ │ │ +Return \fBTrue\fP if x is odd, \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_power() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is a perfect power (there exists a y and an │ │ │ │ -n > 1, such that x=y**n), else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_power() -> bool │ │ │ │ +Return \fBTrue\fP if x is a perfect power (there exists a y and an │ │ │ │ +n > 1, such that x=y**n), else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_prime(n=25, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is \fIprobably\fP prime, else \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' if x is │ │ │ │ +.B is_prime(n=25, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is \fIprobably\fP prime, else \fBFalse\fP if x is │ │ │ │ definitely composite. x is checked for small divisors and up │ │ │ │ to n Miller\-Rabin tests are performed. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_probab_prime(n=25, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B is_probab_prime(n=25, /) -> int │ │ │ │ Return 2 if x is definitely prime, 1 if x is probably prime, │ │ │ │ or return 0 if x is definitely non\-prime. x is checked for small │ │ │ │ divisors and up to n Miller\-Rabin tests are performed. Reasonable │ │ │ │ values of n are between 15 and 50. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_square() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Returns \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is a perfect square, else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_square() -> bool │ │ │ │ +Returns \fBTrue\fP if x is a perfect square, else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B num_digits(base=10, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B num_digits(base=10, /) -> int │ │ │ │ Return length of string representing the absolute value of x in │ │ │ │ the given base. Values for base can range between 2 and 62. The │ │ │ │ value returned may be 1 too large. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B to_bytes(length=1, byteorder=\(aqbig\(aq, *, signed=False) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' │ │ │ │ +.B to_bytes(length=1, byteorder=\(aqbig\(aq, *, signed=False) -> bytes │ │ │ │ Return an array of bytes representing an integer. │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B length │ │ │ │ -Length of bytes object to use. An \X'tty: link https://docs.python.org/3/library/exceptions.html#OverflowError'\fI\%OverflowError\fP\X'tty: link' is raised if the │ │ │ │ +Length of bytes object to use. An \fBOverflowError\fP is raised if the │ │ │ │ integer is not representable with the given number of bytes. │ │ │ │ .TP │ │ │ │ .B byteorder │ │ │ │ The byte order used to represent the integer. If byteorder is │ │ │ │ \(aqbig\(aq, the most significant byte is at the beginning of the byte │ │ │ │ array. If byteorder is \(aqlittle\(aq, the most significant byte is at │ │ │ │ the end of the byte array. To request the native byte order of the │ │ │ │ -host system, use \X'tty: link https://docs.python.org/3/library/sys.html#sys.byteorder'\fI\%sys.byteorder\fP\X'tty: link' as the byte order value. │ │ │ │ +host system, use \fBsys.byteorder\fP as the byte order value. │ │ │ │ .TP │ │ │ │ .B signed │ │ │ │ Determines whether two\(aqs complement is used to represent the │ │ │ │ -integer. If signed is \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' and a negative integer is given, │ │ │ │ -an \X'tty: link https://docs.python.org/3/library/exceptions.html#OverflowError'\fI\%OverflowError\fP\X'tty: link' is raised. │ │ │ │ +integer. If signed is \fBFalse\fP and a negative integer is given, │ │ │ │ +an \fBOverflowError\fP is raised. │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B denominator │ │ │ │ @@ -638,57 +638,57 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.bit_clear(x, n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit cleared. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.bit_count(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.bit_count(x, /) -> int │ │ │ │ Return the number of 1\-bits set in abs(x). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.bit_flip(x, n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit inverted. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.bit_length(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.bit_length(x, /) -> int │ │ │ │ Return the number of significant bits in the radix\-2 │ │ │ │ representation of x. Note: bit_length(0) returns 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.bit_mask(n, /) -> \fI\%mpz\fP │ │ │ │ Return an \fI\%mpz\fP exactly n bits in length with all bits set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.bit_scan0(x, n=0, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B gmpy2.bit_scan0(x, n=0, /) -> int | None │ │ │ │ Return the index of the first 0\-bit of x with index >= n. n >= 0. │ │ │ │ If there are no more 0\-bits in x at or above index n (which can │ │ │ │ only happen for x<0, assuming an infinitely long 2\(aqs complement │ │ │ │ -format), then \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' is returned. │ │ │ │ +format), then \fBNone\fP is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.bit_scan1(x, n=0, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B gmpy2.bit_scan1(x, n=0, /) -> int | None │ │ │ │ Return the index of the first 1\-bit of x with index >= n. n >= 0. │ │ │ │ If there are no more 1\-bits in x at or above index n (which can │ │ │ │ only happen for x>=0, assuming an infinitely long 2\(aqs complement │ │ │ │ -format), then \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' is returned. │ │ │ │ +format), then \fBNone\fP is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.bit_set(x, n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.bit_test(x, n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ +.B gmpy2.bit_test(x, n, /) -> bool │ │ │ │ Return the value of the n\-th bit of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.c_div(x, y, /) -> \fI\%mpz\fP │ │ │ │ Return the quotient of x divided by y. The quotient is rounded │ │ │ │ towards +Inf (ceiling rounding). x and y must be integers. │ │ │ │ @@ -697,22 +697,22 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.c_div_2exp(x, n, /) -> \fI\%mpz\fP │ │ │ │ Returns the quotient of x divided by 2**n. The quotient is rounded │ │ │ │ towards +Inf (ceiling rounding). x must be an integer. n must be >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.c_divmod(x, y, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.c_divmod(x, y, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return the quotient and remainder of x divided by y. The quotient │ │ │ │ is rounded towards +Inf (ceiling rounding) and the remainder will │ │ │ │ have the opposite sign of y. x and y must be integers. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.c_divmod_2exp(x, n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.c_divmod_2exp(x, n, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return the quotient and remainder of x divided by 2**n. The quotient │ │ │ │ is rounded towards +Inf (ceiling rounding) and the remainder will │ │ │ │ be negative. x must be an integer. n must be >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.c_mod(x, y, /) -> \fI\%mpz\fP │ │ │ │ @@ -736,15 +736,15 @@ │ │ │ │ .B gmpy2.divexact(x, y, /) -> \fI\%mpz\fP │ │ │ │ Return the quotient of x divided by y. Faster than standard │ │ │ │ division but requires the remainder is zero! │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.divm(a, b, m, /) -> \fI\%mpz\fP │ │ │ │ -Return x such that b*x == a mod m. Raises a \X'tty: link https://docs.python.org/3/library/exceptions.html#ZeroDivisionError'\fI\%ZeroDivisionError\fP\X'tty: link' │ │ │ │ +Return x such that b*x == a mod m. Raises a \fBZeroDivisionError\fP │ │ │ │ exception if no such value x exists. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.double_fac(n, /) -> \fI\%mpz\fP │ │ │ │ Return the exact double factorial (n!!) of n. The double │ │ │ │ factorial is defined as n*(n\-2)*(n\-4)... │ │ │ │ @@ -759,22 +759,22 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.f_div_2exp(x, n, /) -> \fI\%mpz\fP │ │ │ │ Return the quotient of x divided by 2**n. The quotient is rounded │ │ │ │ towards \-Inf (floor rounding). x must be an integer. n must be >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.f_divmod(x, y, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.f_divmod(x, y, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return the quotient and remainder of x divided by y. The quotient │ │ │ │ is rounded towards \-Inf (floor rounding) and the remainder will │ │ │ │ have the same sign as y. x and y must be integers. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.f_divmod_2exp(x, n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.f_divmod_2exp(x, n, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return quotient and remainder after dividing x by 2**n. The quotient │ │ │ │ is rounded towards \-Inf (floor rounding) and the remainder will be │ │ │ │ positive. x must be an integer. n must be >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.f_mod(x, y, /) -> \fI\%mpz\fP │ │ │ │ @@ -797,97 +797,97 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.fib(n, /) -> \fI\%mpz\fP │ │ │ │ Return the n\-th Fibonacci number. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.fib2(n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.fib2(n, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return a 2\-tuple with the (n\-1)\-th and n\-th Fibonacci numbers. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.gcd(*integers, /) -> \fI\%mpz\fP │ │ │ │ Return the greatest common divisor of integers. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.gcdext(a, b, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.gcdext(a, b, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return a 3\-element tuple (g,s,t) such that g == gcd(a,b) │ │ │ │ and g == a*s + b*t. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.hamdist(x, y, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.hamdist(x, y, /) -> int │ │ │ │ Return the Hamming distance (number of bit\-positions where the │ │ │ │ bits differ) between integers x and y. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.invert(x, m, /) -> \fI\%mpz\fP │ │ │ │ -Return y such that x*y == 1 modulo m. Raises \X'tty: link https://docs.python.org/3/library/exceptions.html#ZeroDivisionError'\fI\%ZeroDivisionError\fP\X'tty: link' if no │ │ │ │ +Return y such that x*y == 1 modulo m. Raises \fBZeroDivisionError\fP if no │ │ │ │ inverse exists. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.iroot(x, n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link'] │ │ │ │ -Return the integer n\-th root of x and boolean value that is \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' │ │ │ │ +.B gmpy2.iroot(x, n, /) -> tuple[\fI\%mpz\fP, bool] │ │ │ │ +Return the integer n\-th root of x and boolean value that is \fBTrue\fP │ │ │ │ iff the root is exact. x >= 0. n > 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.iroot_rem(x, n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.iroot_rem(x, n, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return a 2\-element tuple (y,r), such that y is the integer n\-th │ │ │ │ root of x and x=y**n + r. x >= 0. n > 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_congruent(x, y, m, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Returns \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is congruent to y modulo m, else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B gmpy2.is_congruent(x, y, m, /) -> bool │ │ │ │ +Returns \fBTrue\fP if x is congruent to y modulo m, else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_divisible(x, d, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Returns \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is divisible by d, else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B gmpy2.is_divisible(x, d, /) -> bool │ │ │ │ +Returns \fBTrue\fP if x is divisible by d, else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_even(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is even, \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B gmpy2.is_even(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is even, \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_odd(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is odd, \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B gmpy2.is_odd(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is odd, \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_power(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is a perfect power (there exists a y and an │ │ │ │ -n > 1, such that x=y**n), else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B gmpy2.is_power(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is a perfect power (there exists a y and an │ │ │ │ +n > 1, such that x=y**n), else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_prime(x, n=25, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is \fIprobably\fP prime, else \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' if x is │ │ │ │ +.B gmpy2.is_prime(x, n=25, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is \fIprobably\fP prime, else \fBFalse\fP if x is │ │ │ │ definitely composite. x is checked for small divisors and up │ │ │ │ to n Miller\-Rabin tests are performed. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_probab_prime(x, n=25, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.is_probab_prime(x, n=25, /) -> int │ │ │ │ Return 2 if x is definitely prime, 1 if x is probably prime, │ │ │ │ or return 0 if x is definitely non\-prime. x is checked for small │ │ │ │ divisors and up to n Miller\-Rabin tests are performed. Reasonable │ │ │ │ values of n are between 15 and 50. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_square(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Returns \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is a perfect square, else return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B gmpy2.is_square(x, /) -> bool │ │ │ │ +Returns \fBTrue\fP if x is a perfect square, else return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.isqrt(x, /) -> \fI\%mpz\fP │ │ │ │ Return the integer square root of a non\-negative integer x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ @@ -919,15 +919,15 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.lucas(n, /) -> \fI\%mpz\fP │ │ │ │ Return the n\-th Lucas number. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.lucas2(n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.lucas2(n, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return a 2\-tuple with the (n\-1)\-th and n\-th Lucas numbers. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.mpz_random(random_state, int, /) -> \fI\%mpz\fP │ │ │ │ Return uniformly distributed random integer between 0 and n\-1. │ │ │ │ .UNINDENT │ │ │ │ @@ -951,48 +951,48 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.next_prime(x, /) -> \fI\%mpz\fP │ │ │ │ Return the next \fIprobable\fP prime number > x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.num_digits(x, base=10, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.num_digits(x, base=10, /) -> int │ │ │ │ Return length of string representing the absolute value of x in │ │ │ │ the given base. Values for base can range between 2 and 62. The │ │ │ │ value returned may be 1 too large. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.pack(lst, n, /) -> \fI\%mpz\fP │ │ │ │ Pack a list of integers lst into a single \fI\%mpz\fP by concatenating │ │ │ │ each integer element of lst after padding to length n bits. Raises │ │ │ │ an error if any integer is negative or greater than n bits in │ │ │ │ length. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.popcount(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.popcount(x, /) -> int │ │ │ │ Return the number of 1\-bits set in x. If x<0, the number of │ │ │ │ 1\-bits is infinite so \-1 is returned in that case. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.powmod(x, y, m, /) -> \fI\%mpz\fP │ │ │ │ Return (x**y) mod m. Same as the three argument version of Python\(aqs │ │ │ │ -built\-in \X'tty: link https://docs.python.org/3/library/functions.html#pow'\fI\%pow\fP\X'tty: link', but converts all three arguments to \fI\%mpz\fP\&. │ │ │ │ +built\-in \fBpow\fP, but converts all three arguments to \fI\%mpz\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.powmod_exp_list(base, exp_lst, mod, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link'[\fI\%mpz\fP, \&...] │ │ │ │ +.B gmpy2.powmod_exp_list(base, exp_lst, mod, /) -> list[\fI\%mpz\fP, \&...] │ │ │ │ Returns list(powmod(base, i, mod) for i in exp_lst). Will always release │ │ │ │ the GIL. (Experimental in gmpy2 2.1.x). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.powmod_base_list(base_lst, exp, mod, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link'[\fI\%mpz\fP, \&...] │ │ │ │ +.B gmpy2.powmod_base_list(base_lst, exp, mod, /) -> list[\fI\%mpz\fP, \&...] │ │ │ │ Returns list(powmod(i, exp, mod) for i in base_lst). Will always release │ │ │ │ the GIL. (Experimental in gmpy2 2.1.x). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.powmod_sec(x, y, m, /) -> \fI\%mpz\fP │ │ │ │ Return (x**y) mod m. Calculates x ** y (mod m) but using a constant │ │ │ │ @@ -1009,15 +1009,15 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.primorial(n, /) -> \fI\%mpz\fP │ │ │ │ Return the product of all positive prime numbers less than or │ │ │ │ equal to n. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.remove(x, f, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.remove(x, f, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return a 2\-element tuple (y,m) such that x=y*(f**m) and f does │ │ │ │ not divide y. Remove the factor f from x as many times as │ │ │ │ possible. m is the multiplicity f in x. f > 1. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.t_div(x, y, /) -> \fI\%mpz\fP │ │ │ │ @@ -1028,22 +1028,22 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.t_div_2exp(x, n, /) -> \fI\%mpz\fP │ │ │ │ Return the quotient of x divided by 2**n. The quotient is rounded │ │ │ │ towards zero (truncation). n must be >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.t_divmod(x, y, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.t_divmod(x, y, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return the quotient and remainder of x divided by y. The quotient │ │ │ │ is rounded towards zero (truncation) and the remainder will have │ │ │ │ the same sign as x. x and y must be integers. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.t_divmod_2exp(x, n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B gmpy2.t_divmod_2exp(x, n, /) -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return the quotient and remainder of x divided by 2**n. The quotient │ │ │ │ is rounded towards zero (truncation) and the remainder will have the │ │ │ │ same sign as x. x must be an integer. n must be >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.t_mod(x, y, /) -> \fI\%mpz\fP │ │ │ │ @@ -1054,15 +1054,15 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.t_mod_2exp(x, n, /) -> \fI\%mpz\fP │ │ │ │ Return the remainder of x divided by 2**n. The remainder will have │ │ │ │ the same sign as x. x must be an integer. n must be >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.unpack(x, n, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' │ │ │ │ +.B gmpy2.unpack(x, n, /) -> list │ │ │ │ Unpack an integer x into a list of n\-bit values. Equivalent to │ │ │ │ repeated division by 2**n. Raises error if x is negative. │ │ │ │ .UNINDENT │ │ │ │ .SS Integers (Advanced topics) │ │ │ │ .sp │ │ │ │ gmpy2 provides access to an experimental integer type called \fI\%xmpz\fP\&. The │ │ │ │ \fI\%xmpz\fP type is a mutable integer type. In\-place operations (+=, //=, │ │ │ │ @@ -1214,15 +1214,15 @@ │ │ │ │ or a string s made of digits in the given base. Every input, │ │ │ │ that is accepted by the \fI\%mpz\fP type constructor is also accepted. │ │ │ │ .sp │ │ │ │ Note: This type can be faster when used for augmented assignment │ │ │ │ (+=, \-=, etc), but \fI\%xmpz\fP objects cannot be used as dictionary keys. │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B __format__(fmt) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B __format__(fmt) -> str │ │ │ │ Return a Python string by formatting \fI\%mpz\fP \(aqx\(aq using the format string │ │ │ │ \(aqfmt\(aq. A valid format string consists of: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ optional alignment code: │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ @@ -1268,52 +1268,52 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B bit_clear(n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit cleared. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_count() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B bit_count() -> int │ │ │ │ Return the number of 1\-bits set in abs(x). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B bit_flip(n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit inverted. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_length() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B bit_length() -> int │ │ │ │ Return the number of significant bits in the radix\-2 │ │ │ │ representation of x. Note: mpz(0).bit_length() returns 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_scan0(n=0, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B bit_scan0(n=0, /) -> int | None │ │ │ │ Return the index of the first 0\-bit of x with index >= n. n >= 0. │ │ │ │ If there are no more 0\-bits in x at or above index n (which can │ │ │ │ only happen for x<0, assuming an infinitely long 2\(aqs complement │ │ │ │ -format), then \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' is returned. │ │ │ │ +format), then \fBNone\fP is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_scan1(n=0, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B bit_scan1(n=0, /) -> int | None │ │ │ │ Return the index of the first 1\-bit of x with index >= n. n >= 0. │ │ │ │ If there are no more 1\-bits in x at or above index n (which can │ │ │ │ only happen for x>=0, assuming an infinitely long 2\(aqs complement │ │ │ │ -format), then \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' is returned. │ │ │ │ +format), then \fBNone\fP is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B bit_set(n, /) -> \fI\%mpz\fP │ │ │ │ Return a copy of x with the n\-th bit set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B bit_test(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ +.B bit_test(n, /) -> bool │ │ │ │ Return the value of the n\-th bit of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B conjugate() -> \fI\%mpz\fP │ │ │ │ Return the conjugate of x (which is just a new reference to x since x is │ │ │ │ not a complex number). │ │ │ │ @@ -1321,72 +1321,72 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B copy() -> \fI\%xmpz\fP │ │ │ │ Return a copy of a x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B digits(base=10, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B digits(base=10, /) -> str │ │ │ │ Return Python string representing x in the given base. Values for │ │ │ │ base can range between 2 to 62. A leading \(aq\-\(aq is present if x<0 │ │ │ │ but no leading \(aq+\(aq is present if x>=0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B iter_bits(start=0, stop=\-1) -> \X'tty: link https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator'\fI\%collections.abc.Iterator\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' or \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' for each bit position in x beginning at │ │ │ │ +.B iter_bits(start=0, stop=\-1) -> collections.abc.Iterator │ │ │ │ +Return \fBTrue\fP or \fBFalse\fP for each bit position in x beginning at │ │ │ │ \(aqstart\(aq. If a positive value is specified for \(aqstop\(aq, iteration is │ │ │ │ continued until \(aqstop\(aq is reached. If a negative value is specified, │ │ │ │ iteration is continued until the last 1\-bit. Note: the value of the │ │ │ │ underlying \fI\%xmpz\fP object can change during iteration. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B iter_clear(start=0, stop=\-1) -> \X'tty: link https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator'\fI\%collections.abc.Iterator\fP\X'tty: link' │ │ │ │ +.B iter_clear(start=0, stop=\-1) -> collections.abc.Iterator │ │ │ │ Return every bit position that is clear in x, beginning at │ │ │ │ \(aqstart\(aq. If a positive value is specified for \(aqstop\(aq, iteration │ │ │ │ is continued until \(aqstop\(aq is reached. If a negative value is specified, │ │ │ │ iteration is continued until the last 1\-bit. Note: the value of the │ │ │ │ underlying \fI\%xmpz\fP object can change during iteration. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B iter_set(start=0, stop=\-1) -> \X'tty: link https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator'\fI\%collections.abc.Iterator\fP\X'tty: link' │ │ │ │ +.B iter_set(start=0, stop=\-1) -> collections.abc.Iterator │ │ │ │ Return an iterator yielding the bit position for every bit that │ │ │ │ is set in x, beginning at \(aqstart\(aq. If a positive value is │ │ │ │ specified for \(aqstop\(aq, iteration is continued until \(aqstop\(aq is │ │ │ │ reached. To match the behavior of slicing, \(aqstop\(aq is not included. │ │ │ │ If a negative value is specified, iteration is continued until │ │ │ │ the last 1\-bit. Note: the value of the underlying \fI\%xmpz\fP object can │ │ │ │ change during iteration. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B limbs_finish(n, /) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B limbs_finish(n, /) -> None │ │ │ │ Must be called after writing to the address returned by │ │ │ │ x.limbs_write(n) or x.limbs_modify(n) to update │ │ │ │ the limbs of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B limbs_modify(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B limbs_modify(n, /) -> int │ │ │ │ Returns the address of a mutable buffer representing the limbs │ │ │ │ of x, resized so that it may hold at least n limbs. │ │ │ │ Must be followed by a call to x.limbs_finish(n) after writing to │ │ │ │ the returned address in order for the changes to take effect. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B limbs_read() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B limbs_read() -> int │ │ │ │ Returns the address of the immutable buffer representing the │ │ │ │ limbs of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B limbs_write(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B limbs_write(n, /) -> int │ │ │ │ Returns the address of a mutable buffer representing the limbs │ │ │ │ of x, resized so that it may hold at least n limbs. │ │ │ │ Must be followed by a call to x.limbs_finish(n) after writing to │ │ │ │ the returned address in order for the changes to take effect. │ │ │ │ WARNING: this operation is destructive and may destroy the old │ │ │ │ value of x. │ │ │ │ .UNINDENT │ │ │ │ @@ -1395,22 +1395,22 @@ │ │ │ │ .B make_mpz() -> \fI\%mpz\fP │ │ │ │ Return an \fI\%mpz\fP by converting x as quickly as possible. │ │ │ │ .sp │ │ │ │ NOTE: Optimized for speed so the original \fI\%xmpz\fP value is set to 0! │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B num_digits(base=10, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B num_digits(base=10, /) -> int │ │ │ │ Return length of string representing the absolute value of x in │ │ │ │ the given base. Values for base can range between 2 and 62. The │ │ │ │ value returned may be 1 too large. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B num_limbs() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B num_limbs() -> int │ │ │ │ Return the number of limbs of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B denominator │ │ │ │ the denominator of a rational number in lowest terms │ │ │ │ .UNINDENT │ │ │ │ @@ -1430,23 +1430,23 @@ │ │ │ │ The following functions are based on mpz_lucas.c and mpz_prp.c by David │ │ │ │ Cleaver. │ │ │ │ .sp │ │ │ │ A good reference for probable prime testing is │ │ │ │ \X'tty: link http://www.pseudoprime.com/pseudo.html'\fI\%http://www.pseudoprime.com/pseudo.html\fP\X'tty: link' │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_bpsw_prp(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a Baillie\-Pomerance\-Selfridge\-Wagstaff probable │ │ │ │ +.B gmpy2.is_bpsw_prp(n, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a Baillie\-Pomerance\-Selfridge\-Wagstaff probable │ │ │ │ prime. A BPSW probable prime passes the \fI\%is_strong_prp()\fP test with base │ │ │ │ 2 and the \fI\%is_selfridge_prp()\fP test. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_euler_prp(n, a, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is an Euler (also known as Solovay\-Strassen) │ │ │ │ +.B gmpy2.is_euler_prp(n, a, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is an Euler (also known as Solovay\-Strassen) │ │ │ │ probable prime to the base a. │ │ │ │ Assuming: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ gcd(n,a) == 1 │ │ │ │ n is odd │ │ │ │ .UNINDENT │ │ │ │ @@ -1459,16 +1459,16 @@ │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .sp │ │ │ │ where (a/n) is the Jacobi symbol. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_extra_strong_lucas_prp(n, p, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is an extra strong Lucas probable prime with parameters │ │ │ │ +.B gmpy2.is_extra_strong_lucas_prp(n, p, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is an extra strong Lucas probable prime with parameters │ │ │ │ (p,1). Assuming: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ n is odd │ │ │ │ D = p*p \- 4, D != 0 │ │ │ │ gcd(n, 2*D) == 1 │ │ │ │ n = s*(2**r) + Jacobi(D,n), s odd │ │ │ │ @@ -1482,16 +1482,16 @@ │ │ │ │ or │ │ │ │ lucasv(p,1,s*(2**t)) == 0 (mod n) for some t, 0 <= t < r │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_fermat_prp(n, a, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a Fermat probable prime to the base a. │ │ │ │ +.B gmpy2.is_fermat_prp(n, a, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a Fermat probable prime to the base a. │ │ │ │ Assuming: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ gcd(n,a) == 1 │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .sp │ │ │ │ @@ -1500,16 +1500,16 @@ │ │ │ │ .INDENT 3.5 │ │ │ │ a**(n\-1) == 1 (mod n) │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_fibonacci_prp(n, p, q, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a Fibonacci probable prime with parameters (p,q). │ │ │ │ +.B gmpy2.is_fibonacci_prp(n, p, q, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a Fibonacci probable prime with parameters (p,q). │ │ │ │ Assuming: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ n is odd │ │ │ │ p > 0, q = +/\-1 │ │ │ │ p*p \- 4*q != 0 │ │ │ │ .UNINDENT │ │ │ │ @@ -1520,16 +1520,16 @@ │ │ │ │ .INDENT 3.5 │ │ │ │ lucasv(p,q,n) == p (mod n). │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_lucas_prp(n, p, q, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a Lucas probable prime with parameters (p,q). │ │ │ │ +.B gmpy2.is_lucas_prp(n, p, q, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a Lucas probable prime with parameters (p,q). │ │ │ │ Assuming: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ n is odd │ │ │ │ D = p*p \- 4*q, D != 0 │ │ │ │ gcd(n, 2*q*D) == 1 │ │ │ │ .UNINDENT │ │ │ │ @@ -1540,32 +1540,32 @@ │ │ │ │ .INDENT 3.5 │ │ │ │ lucasu(p,q,n \- Jacobi(D,n)) == 0 (mod n) │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_selfridge_prp(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a Lucas probable prime with Selfidge parameters │ │ │ │ +.B gmpy2.is_selfridge_prp(n, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a Lucas probable prime with Selfidge parameters │ │ │ │ (p,q). The Selfridge parameters are chosen by finding the first │ │ │ │ element D in the sequence {5, \-7, 9, \-11, 13, ...} such that │ │ │ │ Jacobi(D,n) == \-1. Then let p=1 and q = (1\-D)/4. Then perform │ │ │ │ a Lucas probable prime test. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_strong_bpsw_prp(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a strong Baillie\-Pomerance\-Selfridge\-Wagstaff │ │ │ │ +.B gmpy2.is_strong_bpsw_prp(n, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a strong Baillie\-Pomerance\-Selfridge\-Wagstaff │ │ │ │ probable prime. A strong BPSW probable prime passes the \fI\%is_strong_prp()\fP │ │ │ │ test with base and the \fI\%is_strong_selfridge_prp()\fP test. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_strong_lucas_prp(n, p, q, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a strong Lucas probable prime with parameters (p,q). │ │ │ │ +.B gmpy2.is_strong_lucas_prp(n, p, q, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a strong Lucas probable prime with parameters (p,q). │ │ │ │ Assuming: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ n is odd │ │ │ │ D = p*p \- 4*q, D != 0 │ │ │ │ gcd(n, 2*q*D) == 1 │ │ │ │ n = s*(2**r) + Jacobi(D,n), s odd │ │ │ │ @@ -1579,16 +1579,16 @@ │ │ │ │ or │ │ │ │ lucasv(p,q,s*(2**t)) == 0 (mod n) for some t, 0 <= t < r │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_strong_prp(n, a, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a strong (also known as Miller\-Rabin) │ │ │ │ +.B gmpy2.is_strong_prp(n, a, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a strong (also known as Miller\-Rabin) │ │ │ │ probable prime to the base a. │ │ │ │ Assuming: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ gcd(n,a) == 1 │ │ │ │ n is odd │ │ │ │ n = s*(2**r) + 1, with s odd │ │ │ │ @@ -1602,16 +1602,16 @@ │ │ │ │ or │ │ │ │ a**(s*(2**t)) == \-1 (mod n) for some t, 0 <= t < r. │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_strong_selfridge_prp(n, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if n is a strong Lucas probable prime with Selfidge │ │ │ │ +.B gmpy2.is_strong_selfridge_prp(n, /) -> bool │ │ │ │ +Return \fBTrue\fP if n is a strong Lucas probable prime with Selfidge │ │ │ │ parameters (p,q). The Selfridge parameters are chosen by finding │ │ │ │ the first element D in the sequence {5, \-7, 9, \-11, 13, ...} such │ │ │ │ that Jacobi(D,n) == \-1. Then let p=1 and q = (1\-D)/4. Then perform │ │ │ │ a strong Lucas probable prime test. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ @@ -1645,49 +1645,49 @@ │ │ │ │ .TP │ │ │ │ .B class gmpy2.mpq(n=0, /) │ │ │ │ .TP │ │ │ │ .B class gmpy2.mpq(n, m, /) │ │ │ │ .TP │ │ │ │ .B class gmpy2.mpq(s, /, base=10) │ │ │ │ Return a rational number constructed from a non\-complex number n │ │ │ │ -exactly or from a pair of \X'tty: link https://docs.python.org/3/library/numbers.html#numbers.Rational'\fI\%Rational\fP\X'tty: link' values n and m or │ │ │ │ +exactly or from a pair of \fBRational\fP values n and m or │ │ │ │ from a string s made up of digits in the given base. │ │ │ │ -Every input, that is accepted by the \X'tty: link https://docs.python.org/3/library/fractions.html#fractions.Fraction'\fI\%Fraction\fP\X'tty: link' type │ │ │ │ +Every input, that is accepted by the \fBFraction\fP type │ │ │ │ constructor is also accepted. │ │ │ │ .sp │ │ │ │ A string may be made up to two integers in the same base separated │ │ │ │ by a \(aq/\(aq character, both parsed the same as the \fI\%mpz\fP type constructor │ │ │ │ does. If base is 0 then the leading characters are used to recognize the │ │ │ │ base, this is done separately for the numerator and denominator. If │ │ │ │ base=10, any string that represents a finite value and is accepted by │ │ │ │ -the \X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link' constructor is also accepted. │ │ │ │ +the \fBfloat\fP constructor is also accepted. │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B as_integer_ratio() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B as_integer_ratio() -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return a pair of integers, whose ratio is exactly equal to the │ │ │ │ original number. The ratio is in lowest terms and has a │ │ │ │ positive denominator. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B conjugate() -> \fI\%mpz\fP │ │ │ │ Return the conjugate of x (which is just a new reference to x since x is │ │ │ │ not a complex number). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B digits(base=10, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B digits(base=10, /) -> str │ │ │ │ Return a Python string representing x in the given base (2 to 62, │ │ │ │ default is 10). A leading \(aq\-\(aq is present if x<0, but no leading \(aq+\(aq │ │ │ │ is present if x>=0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B from_decimal(dec, /) -> \fI\%mpq\fP │ │ │ │ -Converts a finite \X'tty: link https://docs.python.org/3/library/decimal.html#decimal.Decimal'\fI\%decimal.Decimal\fP\X'tty: link' instance to a rational number, exactly. │ │ │ │ +Converts a finite \fBdecimal.Decimal\fP instance to a rational number, exactly. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B from_float(f, /) -> \fI\%mpq\fP │ │ │ │ Converts a finite float to a rational number, exactly. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ @@ -1805,15 +1805,15 @@ │ │ │ │ .TP │ │ │ │ .B check_range(x, /) -> \fI\%mpfr\fP │ │ │ │ Return a new \fI\%mpfr\fP with exponent that lies within the range of emin │ │ │ │ and emax specified by context. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B clear_flags() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B clear_flags() -> None │ │ │ │ Clear all MPFR exception flags. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B const_catalan() -> \fI\%mpfr\fP │ │ │ │ Return the catalan constant using the context\(aqs precision. │ │ │ │ .UNINDENT │ │ │ │ @@ -1886,15 +1886,15 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B div_2exp(x, n, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return \fI\%mpfr\fP or \fI\%mpc\fP divided by 2**n. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B divmod(x, y, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP | \fI\%mpfr\fP, \fI\%mpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP] │ │ │ │ +.B divmod(x, y, /) -> tuple[\fI\%mpz\fP | \fI\%mpfr\fP, \fI\%mpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP] │ │ │ │ Return divmod(x, y). │ │ │ │ .sp │ │ │ │ Note: overflow, underflow, and inexact exceptions are not supported for │ │ │ │ \fI\%mpfr\fP arguments. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ @@ -1976,16 +1976,16 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B frac(x, /) -> \fI\%mpfr\fP │ │ │ │ Return fractional part of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B frexp(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', \fI\%mpfr\fP] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the exponent and mantissa of x. │ │ │ │ +.B frexp(x, /) -> tuple[int, \fI\%mpfr\fP] │ │ │ │ +Return a \fBtuple\fP containing the exponent and mantissa of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B fsum(iterable, /) -> \fI\%mpfr\fP │ │ │ │ Return an accurate sum of the values in the iterable. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ @@ -2001,48 +2001,48 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B hypot(x, y, /) -> \fI\%mpfr\fP │ │ │ │ Return square root of (x**2 + y**2). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_finite(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ -an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real and x.imag are finite. │ │ │ │ +.B is_finite(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ +an \fI\%mpc\fP, return \fBTrue\fP if both x.real and x.imag are finite. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_infinite(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' │ │ │ │ -if either x.real or x.imag is infinite. Otherwise return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_infinite(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \fBTrue\fP │ │ │ │ +if either x.real or x.imag is infinite. Otherwise return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_integer(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is an integer; \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B is_integer(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is an integer; \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_nan(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is NaN (Not\-A\-Number) else \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_nan(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is NaN (Not\-A\-Number) else \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_regular(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is not zero, NaN, or Infinity; \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B is_regular(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is not zero, NaN, or Infinity; \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_signed(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if the sign bit of x is set. │ │ │ │ +.B is_signed(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if the sign bit of x is set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_zero(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is equal to 0. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real │ │ │ │ +.B is_zero(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is equal to 0. If x is an \fI\%mpc\fP, return \fBTrue\fP if both x.real │ │ │ │ and x.imag are equal to 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B j0(x, /) -> \fI\%mpfr\fP │ │ │ │ Return first kind Bessel function of order 0 of x. │ │ │ │ .UNINDENT │ │ │ │ @@ -2055,16 +2055,16 @@ │ │ │ │ .TP │ │ │ │ .B jn(n, x, /) -> \fI\%mpfr\fP │ │ │ │ Return the first kind Bessel function of order n of x. │ │ │ │ Note: the order of the arguments changed in gmpy2 2.2.0a2 │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B lgamma(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the logarithm of the absolute value of │ │ │ │ +.B lgamma(x, /) -> tuple[\fI\%mpfr\fP, int] │ │ │ │ +Return a \fBtuple\fP containing the logarithm of the absolute value of │ │ │ │ gamma(x) and the sign of gamma(x) │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B li2(x, /) -> \fI\%mpfr\fP │ │ │ │ Return real part of dilogarithm of x. │ │ │ │ .UNINDENT │ │ │ │ @@ -2117,16 +2117,16 @@ │ │ │ │ .B mod(x, y, /) -> \fI\%mpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP │ │ │ │ Return mod(x, y). │ │ │ │ Note: overflow, underflow, and inexact exceptions are not supported for │ │ │ │ \fI\%mpfr\fP arguments. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B modf(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the integer and fractional portions │ │ │ │ +.B modf(x, /) -> tuple[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ +Return a \fBtuple\fP containing the integer and fractional portions │ │ │ │ of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B mul(x, y, /) -> \fI\%mpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return x * y. │ │ │ │ .UNINDENT │ │ │ │ @@ -2165,15 +2165,15 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B plus(x, /) -> \fI\%mpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return +x, the context is applied to the result. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B polar(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ +.B polar(x, /) -> tuple[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ Return the polar coordinate form of a complex x that is in │ │ │ │ rectangular form. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B pow(x, y, /) -> \fI\%mpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return x ** y. │ │ │ │ @@ -2210,16 +2210,16 @@ │ │ │ │ .TP │ │ │ │ .B remainder(x, y, /) -> \fI\%mpfr\fP │ │ │ │ Return x \- n*y where n is the integer quotient of x/y, rounded to │ │ │ │ the nearest integer and ties rounded to even. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B remquo(x, y, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the remainder(x,y) and the low bits of the │ │ │ │ +.B remquo(x, y, /) -> tuple[\fI\%mpfr\fP, int] │ │ │ │ +Return a \fBtuple\fP containing the remainder(x,y) and the low bits of the │ │ │ │ quotient. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B rint(x, /) -> \fI\%mpfr\fP │ │ │ │ Return x rounded to the nearest integer using the context rounding │ │ │ │ mode. │ │ │ │ @@ -2294,26 +2294,26 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B sin(x, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return sine of x; x in radians. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B sin_cos(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP | \fI\%mpc\fP, \fI\%mpfr\fP | \fI\%mpc\fP] │ │ │ │ +.B sin_cos(x, /) -> tuple[\fI\%mpfr\fP | \fI\%mpc\fP, \fI\%mpfr\fP | \fI\%mpc\fP] │ │ │ │ Return a tuple containing the sine and cosine of x; x in radians. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B sinh(x, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return hyperbolic sine of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B sinh_cosh(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the hyperbolic sine and cosine of x. │ │ │ │ +.B sinh_cosh(x, /) -> tuple[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ +Return a \fBtuple\fP containing the hyperbolic sine and cosine of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B sqrt(x, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return the square root of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ @@ -2368,15 +2368,15 @@ │ │ │ │ .B allow_complex │ │ │ │ This attribute controls whether or not an \fI\%mpc\fP result can be returned │ │ │ │ if an \fI\%mpfr\fP result would normally not be possible. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B allow_release_gil │ │ │ │ -If set to \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link', many \fI\%mpz\fP and \fI\%mpq\fP computations will release the GIL. │ │ │ │ +If set to \fBTrue\fP, many \fI\%mpz\fP and \fI\%mpq\fP computations will release the GIL. │ │ │ │ .sp │ │ │ │ This is considered an experimental feature. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B divzero │ │ │ │ This flag is not user controllable. It is automatically set if a │ │ │ │ @@ -2427,15 +2427,15 @@ │ │ │ │ This flag is not user controllable. It is automatically set if an │ │ │ │ invalid (Not\-A\-Number) result is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B overflow │ │ │ │ This flag is not user controllable. It is automatically set if a │ │ │ │ -result overflowed to +/\-Infinity and \fI\%trap_overflow\fP is \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +result overflowed to +/\-Infinity and \fI\%trap_overflow\fP is \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B precision │ │ │ │ This attribute controls the precision of an \fI\%mpfr\fP result. The │ │ │ │ precision is specified in bits, not decimal digits. The maximum │ │ │ │ precision that can be specified is platform dependent and can be │ │ │ │ @@ -2443,15 +2443,15 @@ │ │ │ │ .sp │ │ │ │ Note: Specifying a value for precision that is too close to the │ │ │ │ maximum precision will cause the MPFR library to fail. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B rational_division │ │ │ │ -If set to \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link', \fI\%mpz\fP / \fI\%mpz\fP will return an \fI\%mpq\fP instead of an \fI\%mpfr\fP\&. │ │ │ │ +If set to \fBTrue\fP, \fI\%mpz\fP / \fI\%mpz\fP will return an \fI\%mpq\fP instead of an \fI\%mpfr\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B real_prec │ │ │ │ This attribute controls the precision of the real part of an \fI\%mpc\fP │ │ │ │ result. If the value is Default, then the value of the \fI\%precision\fP │ │ │ │ attribute is used. │ │ │ │ @@ -2489,22 +2489,22 @@ │ │ │ │ to precisely mimic the results of IEEE\-754 floating point operations. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B trap_divzero │ │ │ │ This attribute controls whether or not a \fI\%DivisionByZeroError\fP exception │ │ │ │ is raised if division by 0 occurs. The \fI\%DivisionByZeroError\fP is a │ │ │ │ -sub\-class of Python’s \X'tty: link https://docs.python.org/3/library/exceptions.html#ZeroDivisionError'\fI\%ZeroDivisionError\fP\X'tty: link'\&. │ │ │ │ +sub\-class of Python’s \fBZeroDivisionError\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B trap_erange │ │ │ │ This attribute controls whether or not a \fI\%RangeError\fP exception is │ │ │ │ raised when certain operations are performed on NaN and/or Infinity │ │ │ │ -values. Setting \fI\%trap_erange\fP to \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' can be used to raise an exception │ │ │ │ +values. Setting \fI\%trap_erange\fP to \fBTrue\fP can be used to raise an exception │ │ │ │ if comparisons are attempted with a NaN. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B trap_inexact │ │ │ │ This attribute controls whether or not an \fI\%InexactResultError\fP exception │ │ │ │ is raised if an inexact result is returned. To check if the result is │ │ │ │ @@ -2514,39 +2514,39 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B trap_invalid │ │ │ │ This attribute controls whether or not an \fI\%InvalidOperationError\fP │ │ │ │ exception is raised if a numerical result is not defined. A │ │ │ │ special NaN (Not\-A\-Number) value will be returned if an exception │ │ │ │ is not raised. The \fI\%InvalidOperationError\fP is a sub\-class of │ │ │ │ -Python’s \X'tty: link https://docs.python.org/3/library/exceptions.html#ValueError'\fI\%ValueError\fP\X'tty: link'\&. │ │ │ │ +Python’s \fBValueError\fP\&. │ │ │ │ .sp │ │ │ │ For example, gmpy2.sqrt(\-2) will normally │ │ │ │ -return mpfr(‘nan’). However, if \fI\%allow_complex\fP is set to \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link', │ │ │ │ +return mpfr(‘nan’). However, if \fI\%allow_complex\fP is set to \fBTrue\fP, │ │ │ │ then an \fI\%mpc\fP result will be returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B trap_overflow │ │ │ │ -If set to \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link', a result that is larger than the largest possible │ │ │ │ +If set to \fBFalse\fP, a result that is larger than the largest possible │ │ │ │ \fI\%mpfr\fP given the current exponent range will be replaced by +/\-Infinity. │ │ │ │ -If set to \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link', an \fI\%OverflowResultError\fP exception is raised. │ │ │ │ +If set to \fBTrue\fP, an \fI\%OverflowResultError\fP exception is raised. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B trap_underflow │ │ │ │ -If set to \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link', a result that is smaller than the smallest possible │ │ │ │ +If set to \fBFalse\fP, a result that is smaller than the smallest possible │ │ │ │ \fI\%mpfr\fP given the current exponent range will be replaced by +/\-0.0. │ │ │ │ -If set to \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link', an \fI\%UnderflowResultError\fP exception is raised. │ │ │ │ +If set to \fBTrue\fP, an \fI\%UnderflowResultError\fP exception is raised. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B underflow │ │ │ │ This flag is not user controllable. It is automatically set if a │ │ │ │ -result underflowed to +/\-0.0 and \fI\%trap_underflow\fP is \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +result underflowed to +/\-0.0 and \fI\%trap_underflow\fP is \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .SS Context Functions │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.get_context() -> \fI\%context\fP │ │ │ │ Return a reference to the current context. │ │ │ │ @@ -2565,15 +2565,15 @@ │ │ │ │ .B gmpy2.local_context(context, /, **kwargs) -> \fI\%context\fP │ │ │ │ Return a new context for controlling gmpy2 arithmetic, based either │ │ │ │ on the current context or on a ctx value. Context options additionally │ │ │ │ can be overridden by keyword arguments. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.set_context(context, /) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B gmpy2.set_context(context, /) -> None │ │ │ │ Activate a context object controlling gmpy2 arithmetic. │ │ │ │ .UNINDENT │ │ │ │ .SS Exceptions │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B exception gmpy2.RangeError │ │ │ │ .UNINDENT │ │ │ │ @@ -2615,16 +2615,16 @@ │ │ │ │ and/or exponent\-part with an exponent marker \(aqe\(aq or \(aqE\(aq for bases up to │ │ │ │ 10, else \(aq@\(aq in any base. In bases 2 and 16, the exponent prefix can also │ │ │ │ be \(aqp\(aq or \(aqP\(aq, in which case the exponent indicates │ │ │ │ a multiplication by a power of 2 instead of the base. The value of │ │ │ │ an exponent is always written in base 10. The fractional\-part digits │ │ │ │ are parsed the same as the \fI\%mpz\fP type constructor │ │ │ │ does and both the whole number and exponent\-part optionally can be │ │ │ │ -preceded by ‘+’ or ‘\-’. Every input, accepted by the \X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link' type │ │ │ │ -constructor or the \X'tty: link https://docs.python.org/3/library/stdtypes.html#float.fromhex'\fI\%float.fromhex\fP\X'tty: link' method is also accepted. │ │ │ │ +preceded by ‘+’ or ‘\-’. Every input, accepted by the \fBfloat\fP type │ │ │ │ +constructor or the \fBfloat.fromhex\fP method is also accepted. │ │ │ │ .sp │ │ │ │ If a precision greater than or equal to 2 is specified, then it │ │ │ │ is used. A precision of 0 (the default) implies the precision of either │ │ │ │ the specified context or the current context is used. │ │ │ │ A precision of 1 minimizes the loss of precision by following │ │ │ │ these rules: │ │ │ │ .INDENT 7.0 │ │ │ │ @@ -2637,15 +2637,15 @@ │ │ │ │ If n is an integer, then the precision is the bit length │ │ │ │ of the integer. │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B __format__(fmt) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B __format__(fmt) -> str │ │ │ │ Return a Python string by formatting \(aqx\(aq using the format string │ │ │ │ \(aqfmt\(aq. A valid format string consists of: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ optional alignment code: │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ @@ -2690,21 +2690,21 @@ │ │ │ │ .UNINDENT │ │ │ │ .UNINDENT │ │ │ │ .sp │ │ │ │ The default format is \(aq.6f\(aq. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B as_integer_ratio() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ -Return the exact rational equivalent of an \fI\%mpfr\fP\&. Value is a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' │ │ │ │ -for compatibility with Python\(aqs \X'tty: link https://docs.python.org/3/library/stdtypes.html#float.as_integer_ratio'\fI\%float.as_integer_ratio\fP\X'tty: link'\&. │ │ │ │ +.B as_integer_ratio() -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +Return the exact rational equivalent of an \fI\%mpfr\fP\&. Value is a \fBtuple\fP │ │ │ │ +for compatibility with Python\(aqs \fBfloat.as_integer_ratio\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B as_mantissa_exp() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ +.B as_mantissa_exp() -> tuple[\fI\%mpz\fP, \fI\%mpz\fP] │ │ │ │ Return the mantissa and exponent of an \fI\%mpfr\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B as_simple_fraction(precision=0) -> \fI\%mpq\fP │ │ │ │ Return a simple rational approximation to x. The result will be │ │ │ │ accurate to \(aqprecision\(aq bits. If \(aqprecision\(aq is 0, the precision │ │ │ │ @@ -2714,57 +2714,57 @@ │ │ │ │ .TP │ │ │ │ .B conjugate() -> \fI\%mpz\fP │ │ │ │ Return the conjugate of x (which is just a new reference to x since x is │ │ │ │ not a complex number). │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B digits(base=10, prec=0, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] │ │ │ │ +.B digits(base=10, prec=0, /) -> tuple[str, int, int] │ │ │ │ Returns up to \(aqprec\(aq digits in the given base. If \(aqprec\(aq is 0, as many │ │ │ │ digits that are available are returned. No more digits than available │ │ │ │ given x\(aqs precision are returned. \(aqbase\(aq must be between 2 and 62, │ │ │ │ -inclusive. The result is a three element \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the mantissa, │ │ │ │ +inclusive. The result is a three element \fBtuple\fP containing the mantissa, │ │ │ │ the exponent, and the number of bits of precision. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_finite() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ -an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real and x.imag are finite. │ │ │ │ +.B is_finite() -> bool │ │ │ │ +Return \fBTrue\fP if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ +an \fI\%mpc\fP, return \fBTrue\fP if both x.real and x.imag are finite. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_infinite() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' │ │ │ │ -if either x.real or x.imag is infinite. Otherwise return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_infinite() -> bool │ │ │ │ +Return \fBTrue\fP if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \fBTrue\fP │ │ │ │ +if either x.real or x.imag is infinite. Otherwise return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_integer() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is an integer; \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B is_integer() -> bool │ │ │ │ +Return \fBTrue\fP if x is an integer; \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_nan() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is NaN (Not\-A\-Number) else \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_nan() -> bool │ │ │ │ +Return \fBTrue\fP if x is NaN (Not\-A\-Number) else \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_regular() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is not zero, NaN, or Infinity; \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B is_regular() -> bool │ │ │ │ +Return \fBTrue\fP if x is not zero, NaN, or Infinity; \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_signed() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if the sign bit of x is set. │ │ │ │ +.B is_signed() -> bool │ │ │ │ +Return \fBTrue\fP if the sign bit of x is set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_zero() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is equal to 0. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real │ │ │ │ +.B is_zero() -> bool │ │ │ │ +Return \fBTrue\fP if x is equal to 0. If x is an \fI\%mpc\fP, return \fBTrue\fP if both x.real │ │ │ │ and x.imag are equal to 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B imag │ │ │ │ imaginary component │ │ │ │ .UNINDENT │ │ │ │ @@ -2814,15 +2814,15 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.check_range(x, /) -> \fI\%mpfr\fP │ │ │ │ Return a new \fI\%mpfr\fP with exponent that lies within the current range │ │ │ │ of emin and emax. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.cmp(x, y, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.cmp(x, y, /) -> int │ │ │ │ Return \-1 if x < y; 0 if x = y; or 1 if x > y. Both x and y must be │ │ │ │ integer, rational or real. Note: 0 is returned (and exception flag set) │ │ │ │ if either argument is NaN. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.const_catalan(precision=0) -> \fI\%mpfr\fP │ │ │ │ @@ -2938,16 +2938,16 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.frac(x, /) -> \fI\%mpfr\fP │ │ │ │ Return fractional part of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.frexp(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', \fI\%mpfr\fP] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the exponent and mantissa of x. │ │ │ │ +.B gmpy2.frexp(x, /) -> tuple[int, \fI\%mpfr\fP] │ │ │ │ +Return a \fBtuple\fP containing the exponent and mantissa of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.fsum(iterable, /) -> \fI\%mpfr\fP │ │ │ │ Return an accurate sum of the values in the iterable. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ @@ -2958,15 +2958,15 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.gamma_inc(a, x, /) -> \fI\%mpfr\fP │ │ │ │ Return (upper) incomplete gamma of a and x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.get_exp(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.get_exp(x, /) -> int │ │ │ │ Return the exponent of x. Returns 0 for NaN or Infinity and │ │ │ │ sets the \fI\%context.erange\fP flag of the current context and will │ │ │ │ raise an exception if \fI\%context.trap_erange\fP is set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.hypot(x, y, /) -> \fI\%mpfr\fP │ │ │ │ @@ -2976,38 +2976,38 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.inf(n, /) -> \fI\%mpfr\fP │ │ │ │ Return an \fI\%mpfr\fP initialized to Infinity with the same sign as n. │ │ │ │ If n is not given, +Infinity is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_finite(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ -an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real and x.imag are finite. │ │ │ │ +.B gmpy2.is_finite(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ +an \fI\%mpc\fP, return \fBTrue\fP if both x.real and x.imag are finite. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_infinite(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' │ │ │ │ -if either x.real or x.imag is infinite. Otherwise return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B gmpy2.is_infinite(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \fBTrue\fP │ │ │ │ +if either x.real or x.imag is infinite. Otherwise return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_regular(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is not zero, NaN, or Infinity; \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link' otherwise. │ │ │ │ +.B gmpy2.is_regular(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is not zero, NaN, or Infinity; \fBFalse\fP otherwise. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_signed(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if the sign bit of x is set. │ │ │ │ +.B gmpy2.is_signed(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if the sign bit of x is set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_unordered(x, y, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if either x and/or y is NaN. │ │ │ │ +.B gmpy2.is_unordered(x, y, /) -> bool │ │ │ │ +Return \fBTrue\fP if either x and/or y is NaN. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.j0(x, /) -> \fI\%mpfr\fP │ │ │ │ Return first kind Bessel function of order 0 of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ @@ -3019,16 +3019,16 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.jn(n, x, /) -> \fI\%mpfr\fP │ │ │ │ Return the first kind Bessel function of order n of x. │ │ │ │ Note: the order of the arguments changed in gmpy2 2.2.0a2 │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.lgamma(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the logarithm of the absolute value of │ │ │ │ +.B gmpy2.lgamma(x, /) -> tuple[\fI\%mpfr\fP, int] │ │ │ │ +Return a \fBtuple\fP containing the logarithm of the absolute value of │ │ │ │ gamma(x) and the sign of gamma(x) │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.li2(x, /) -> \fI\%mpfr\fP │ │ │ │ Return real part of dilogarithm of x. │ │ │ │ .UNINDENT │ │ │ │ @@ -3059,26 +3059,26 @@ │ │ │ │ .B gmpy2.minnum(x, y, /) -> \fI\%mpfr\fP │ │ │ │ Return the minimum number of x and y. If x and y are not \fI\%mpfr\fP, they are │ │ │ │ converted to \fI\%mpfr\fP\&. The result is rounded to match the current context. │ │ │ │ If only one of x or y is a number, then that number is returned. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.modf(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the integer and fractional portions │ │ │ │ +.B gmpy2.modf(x, /) -> tuple[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ +Return a \fBtuple\fP containing the integer and fractional portions │ │ │ │ of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.mpfr_from_old_binary(string, /) -> \fI\%mpfr\fP │ │ │ │ Return an \fI\%mpfr\fP from a GMPY 1.x binary mpf format. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.mpfr_grandom(random_state, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ +.B gmpy2.mpfr_grandom(random_state, /) -> tuple[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ Return two random numbers with gaussian distribution. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.mpfr_nrandom(random_state, /) │ │ │ │ Return a random number with gaussian distribution. │ │ │ │ .UNINDENT │ │ │ │ @@ -3123,16 +3123,16 @@ │ │ │ │ .TP │ │ │ │ .B gmpy2.remainder(x, y, /) -> \fI\%mpfr\fP │ │ │ │ Return x \- n*y where n is the integer quotient of x/y, rounded to │ │ │ │ the nearest integer and ties rounded to even. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.remquo(x, y, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the remainder(x,y) and the low bits of the │ │ │ │ +.B gmpy2.remquo(x, y, /) -> tuple[\fI\%mpfr\fP, int] │ │ │ │ +Return a \fBtuple\fP containing the remainder(x,y) and the low bits of the │ │ │ │ quotient. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.rint(x, /) -> \fI\%mpfr\fP │ │ │ │ Return x rounded to the nearest integer using the current rounding │ │ │ │ mode. │ │ │ │ @@ -3206,25 +3206,25 @@ │ │ │ │ valid exponents, \fI\%set_exp()\fP will set the \fI\%context.erange\fP flag │ │ │ │ of the current context and either return the original value or raise │ │ │ │ an exception if \fI\%context.trap_erange\fP is set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.set_sign(x, s, /) -> \fI\%mpfr\fP │ │ │ │ -If s is \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link', then return x with the sign bit set. │ │ │ │ +If s is \fBTrue\fP, then return x with the sign bit set. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.sign(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.sign(x, /) -> int │ │ │ │ Return \-1 if x < 0, 0 if x == 0, or +1 if x >0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.sinh_cosh(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ -Return a \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' containing the hyperbolic sine and cosine of x. │ │ │ │ +.B gmpy2.sinh_cosh(x, /) -> tuple[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ +Return a \fBtuple\fP containing the hyperbolic sine and cosine of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.trunc(x, /) -> \fI\%mpfr\fP │ │ │ │ Return an \fI\%mpfr\fP that is x truncated towards 0. Same as │ │ │ │ x.floor() if x>=0 or x.ceil() if x<0. │ │ │ │ .UNINDENT │ │ │ │ @@ -3253,45 +3253,45 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.zeta(x, /) -> \fI\%mpfr\fP │ │ │ │ Return Riemann zeta of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.get_max_precision() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.get_max_precision() -> int │ │ │ │ Return the maximum bits of precision that can be used for calculations. │ │ │ │ Note: to allow extra precision for intermediate calculations, avoid │ │ │ │ setting precision close the maximum precision. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.get_emax_max() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.get_emax_max() -> int │ │ │ │ Return the maximum possible exponent that can be set for \fI\%mpfr\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.get_emin_min() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.get_emin_min() -> int │ │ │ │ Return the minimum possible exponent that can be set for \fI\%mpfr\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.copy_sign(x, y, /) -> \fI\%mpfr\fP │ │ │ │ Return an \fI\%mpfr\fP composed of x with the sign of y. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.can_round(b, err, rnd1, rnd2, prec, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ +.B gmpy2.can_round(b, err, rnd1, rnd2, prec, /) -> bool │ │ │ │ Let b be an approximation to an unknown number x that is rounded │ │ │ │ according to rnd1. Assume the b has an error at most two to the power │ │ │ │ -of E(b)\-err where E(b) is the exponent of b. Then return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x │ │ │ │ +of E(b)\-err where E(b) is the exponent of b. Then return \fBTrue\fP if x │ │ │ │ can be rounded correctly to prec bits with rounding mode rnd2. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.free_cache() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' │ │ │ │ +.B gmpy2.free_cache() -> None │ │ │ │ Free the internal cache of constants maintained by MPFR. │ │ │ │ .UNINDENT │ │ │ │ .SS Multiple\-precision Complex │ │ │ │ .SS mpc Type │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B class gmpy2.mpc(c=0, /, precision=0) │ │ │ │ @@ -3316,15 +3316,15 @@ │ │ │ │ The precision can be specified by either a single number that is used │ │ │ │ for both the real and imaginary components, or as a pair of different │ │ │ │ precisions for the real and imaginary components. For every component, │ │ │ │ the meaning of its precision value is the same as in the \fI\%mpfr\fP │ │ │ │ type constructor. │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B __format__(fmt) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B __format__(fmt) -> str │ │ │ │ Return a Python string by formatting \(aqx\(aq using the format string │ │ │ │ \(aqfmt\(aq. A valid format string consists of: │ │ │ │ .INDENT 7.0 │ │ │ │ .INDENT 3.5 │ │ │ │ optional alignment code: │ │ │ │ .INDENT 0.0 │ │ │ │ .INDENT 3.5 │ │ │ │ @@ -3381,42 +3381,42 @@ │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B conjugate() -> \fI\%mpc\fP │ │ │ │ Returns the conjugate of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B digits(base=10, prec=0, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'], \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link']] │ │ │ │ +.B digits(base=10, prec=0, /) -> tuple[tuple[str, int, int], tuple[str, int, int]] │ │ │ │ Returns up to \(aqprec\(aq digits in the given base. If \(aqprec\(aq is 0, as many │ │ │ │ digits that are available given c\(aqs precision are returned. \(aqbase\(aq must │ │ │ │ be between 2 and 62. The result consists of 2 three\-element tuples that │ │ │ │ contain the mantissa, exponent, and number of bits of precision of the │ │ │ │ real and imaginary components. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_finite() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ -an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real and x.imag are finite. │ │ │ │ +.B is_finite() -> bool │ │ │ │ +Return \fBTrue\fP if x is an actual number (i.e. non NaN or Infinity). If x is │ │ │ │ +an \fI\%mpc\fP, return \fBTrue\fP if both x.real and x.imag are finite. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_infinite() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' │ │ │ │ -if either x.real or x.imag is infinite. Otherwise return \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_infinite() -> bool │ │ │ │ +Return \fBTrue\fP if x is +Infinity or \-Infinity. If x is an \fI\%mpc\fP, return \fBTrue\fP │ │ │ │ +if either x.real or x.imag is infinite. Otherwise return \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_nan() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is NaN (Not\-A\-Number) else \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B is_nan() -> bool │ │ │ │ +Return \fBTrue\fP if x is NaN (Not\-A\-Number) else \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ -.B is_zero() -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is equal to 0. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real │ │ │ │ +.B is_zero() -> bool │ │ │ │ +Return \fBTrue\fP if x is equal to 0. If x is an \fI\%mpc\fP, return \fBTrue\fP if both x.real │ │ │ │ and x.imag are equal to 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 7.0 │ │ │ │ .TP │ │ │ │ .B imag │ │ │ │ imaginary component │ │ │ │ .UNINDENT │ │ │ │ @@ -3485,21 +3485,21 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.exp(x, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return the exponential of x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_nan(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is NaN (Not\-A\-Number) else \X'tty: link https://docs.python.org/3/library/constants.html#False'\fI\%False\fP\X'tty: link'\&. │ │ │ │ +.B gmpy2.is_nan(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is NaN (Not\-A\-Number) else \fBFalse\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.is_zero(x, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' │ │ │ │ -Return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if x is equal to 0. If x is an \fI\%mpc\fP, return \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' if both x.real │ │ │ │ +.B gmpy2.is_zero(x, /) -> bool │ │ │ │ +Return \fBTrue\fP if x is equal to 0. If x is an \fI\%mpc\fP, return \fBTrue\fP if both x.real │ │ │ │ and x.imag are equal to 0. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.log(x, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return the natural logarithm of x. │ │ │ │ .UNINDENT │ │ │ │ @@ -3527,15 +3527,15 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.phase(x, /) -> \fI\%mpfr\fP │ │ │ │ Return the phase angle, also known as argument, of a complex x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.polar(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ +.B gmpy2.polar(x, /) -> tuple[\fI\%mpfr\fP, \fI\%mpfr\fP] │ │ │ │ Return the polar coordinate form of a complex x that is in │ │ │ │ rectangular form. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.proj(x, /) -> \fI\%mpc\fP │ │ │ │ Returns the projection of a complex x on to the Riemann sphere. │ │ │ │ @@ -3554,15 +3554,15 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.sin(x, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return sine of x; x in radians. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.sin_cos(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link'[\fI\%mpfr\fP | \fI\%mpc\fP, \fI\%mpfr\fP | \fI\%mpc\fP] │ │ │ │ +.B gmpy2.sin_cos(x, /) -> tuple[\fI\%mpfr\fP | \fI\%mpc\fP, \fI\%mpfr\fP | \fI\%mpc\fP] │ │ │ │ Return a tuple containing the sine and cosine of x; x in radians. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.sinh(x, /) -> \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return hyperbolic sine of x. │ │ │ │ .UNINDENT │ │ │ │ @@ -3623,70 +3623,70 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.fms(x, y, z, /) -> \fI\%mpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return correctly rounded result of (x * y) \- z. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.cmp_abs(x, y, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.cmp_abs(x, y, /) -> int │ │ │ │ Return \-1 if abs(x) < abs(y); 0 if abs(x) = abs(y); or 1 else. │ │ │ │ .UNINDENT │ │ │ │ .SS Miscellaneous Functions │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.digits(x, base=10, prec=0, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B gmpy2.digits(x, base=10, prec=0, /) -> str │ │ │ │ Return string representing a number x. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ .B gmpy2.from_binary(bytes, /) -> \fI\%mpz\fP | \fI\%xmpz\fP | \fI\%mpq\fP | \fI\%mpfr\fP | \fI\%mpc\fP │ │ │ │ Return a Python object from a byte sequence created by \fI\%to_binary()\fP\&. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.license() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B gmpy2.license() -> str │ │ │ │ Return string giving license information. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.mp_limbsize() -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' │ │ │ │ +.B gmpy2.mp_limbsize() -> int │ │ │ │ Return the number of bits per limb. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.mp_version() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B gmpy2.mp_version() -> str │ │ │ │ Return string giving current GMP version. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.mpc_version() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B gmpy2.mpc_version() -> str │ │ │ │ Return string giving current MPC version. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.mpfr_version() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B gmpy2.mpfr_version() -> str │ │ │ │ Return string giving current MPFR version. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.random_state(seed=0, /) -> \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' │ │ │ │ +.B gmpy2.random_state(seed=0, /) -> object │ │ │ │ Return new object containing state information for the random number │ │ │ │ generator. An optional integer can be specified as the seed value. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.to_binary(x, /) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' │ │ │ │ +.B gmpy2.to_binary(x, /) -> bytes │ │ │ │ Return a Python byte sequence that is a portable binary │ │ │ │ representation of a gmpy2 object x. The byte sequence can │ │ │ │ be passed to \fI\%from_binary()\fP to obtain an exact copy of │ │ │ │ -x\(aqs value. Raises a \X'tty: link https://docs.python.org/3/library/exceptions.html#TypeError'\fI\%TypeError\fP\X'tty: link' if x is not a gmpy2 object. │ │ │ │ +x\(aqs value. Raises a \fBTypeError\fP if x is not a gmpy2 object. │ │ │ │ .UNINDENT │ │ │ │ .INDENT 0.0 │ │ │ │ .TP │ │ │ │ -.B gmpy2.version() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' │ │ │ │ +.B gmpy2.version() -> str │ │ │ │ Return string giving current GMPY2 version. │ │ │ │ .UNINDENT │ │ │ │ .SS Cython usage │ │ │ │ .sp │ │ │ │ The gmpy2 module provides a C\-API that can be conveniently used from Cython. │ │ │ │ All types and functions are declared in the header gmpy2.pxd that is installed │ │ │ │ automatically in your Python path together with the library. │ │ │ │ @@ -4103,15 +4103,15 @@ │ │ │ │ Many bug fixes. │ │ │ │ .UNINDENT │ │ │ │ .SS Changes in gmpy2 2.1.0b1 │ │ │ │ .INDENT 0.0 │ │ │ │ .IP \(bu 2 │ │ │ │ Added \fI\%cmp()\fP and \fI\%cmp_abs()\fP\&. │ │ │ │ .IP \(bu 2 │ │ │ │ -Improved compatibility with the \X'tty: link https://docs.python.org/3/library/numbers.html#module-numbers'\fI\%numbers\fP\X'tty: link' module protocol. │ │ │ │ +Improved compatibility with the \fBnumbers\fP module protocol. │ │ │ │ .IP \(bu 2 │ │ │ │ Many bug fixes. │ │ │ │ .UNINDENT │ │ │ │ .SS Changes in gmpy2 2.1.a05 │ │ │ │ .INDENT 0.0 │ │ │ │ .IP \(bu 2 │ │ │ │ Fix \fI\%qdiv()\fP not returning \fI\%mpz\fP when it should. │ │ │ │ @@ -4178,15 +4178,15 @@ │ │ │ │ Context methods have been added for MPFR/MPC related functions. │ │ │ │ .IP \(bu 2 │ │ │ │ A new context option (\fI\%rational_division\fP) has been added that │ │ │ │ changes the behavior of integer division involving \fI\%mpz\fP instances to return │ │ │ │ a rational result instead of a floating point result. │ │ │ │ .IP \(bu 2 │ │ │ │ gmpy2 types are now registered in the numeric tower of the │ │ │ │ -\X'tty: link https://docs.python.org/3/library/numbers.html#module-numbers'\fI\%numbers\fP\X'tty: link' module. │ │ │ │ +\fBnumbers\fP module. │ │ │ │ .IP \(bu 2 │ │ │ │ In previous versions of gmpy2, \fBmpz()\fP was a factory function that │ │ │ │ returned an \fI\%mpz\fP instance. It is now an actual type. The same │ │ │ │ is true for the other gmpy2 types. │ │ │ │ .IP \(bu 2 │ │ │ │ If a Python object has an \fB__mpz__\fP method, it will be called bye \fBmpz()\fP │ │ │ │ to allow an unrecognized type to be converted to an mpz instance. The same is │ │ │ │ @@ -4234,15 +4234,15 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .IP \(bu 2 │ │ │ │ Fix segmentation fault in \fB_mpmath_normalize()\fP (an undocumented helper │ │ │ │ function for mpmath). (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Fix issues when compiled without support for MPFR. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Conversion of too large an \fI\%mpz\fP to \X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link' now raises \X'tty: link https://docs.python.org/3/library/exceptions.html#OverflowError'\fI\%OverflowError\fP\X'tty: link' │ │ │ │ +Conversion of too large an \fI\%mpz\fP to \fBfloat\fP now raises \fBOverflowError\fP │ │ │ │ instead of returning \fBinf\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Renamed \fBmin2()/max2()\fP to \fI\%minnum()\fP/\fI\%maxnum()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ The build and install process (i.e. \fBsetup.py\fP) has been completely │ │ │ │ rewritten. See the Installation section for more information. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ @@ -4267,15 +4267,15 @@ │ │ │ │ .IP \(bu 2 │ │ │ │ If no arguments are given to \fI\%mpz\fP, \fI\%mpq\fP, \fI\%mpfr\fP, \fI\%mpc\fP, and \fI\%xmpz\fP, │ │ │ │ return 0 of the appropriate type. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Fix broken comparison between \fI\%mpz\fP and \fI\%mpq\fP when \fI\%mpz\fP is on │ │ │ │ the left. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Added \fB__sizeof__()\fP to all types. Note: \X'tty: link https://docs.python.org/3/library/sys.html#sys.getsizeof'\fI\%sys.getsizeof()\fP\X'tty: link' calls │ │ │ │ +Added \fB__sizeof__()\fP to all types. Note: \fBsys.getsizeof()\fP calls │ │ │ │ \fB__sizeof__()\fP to get the memory size of a gmpy2 object. The returned │ │ │ │ value reflects the size of the allocated memory which may be larger than │ │ │ │ the actual minimum memory required by the object. (casevh) │ │ │ │ .UNINDENT │ │ │ │ .SS Known issues in gmpy2 2.0.0b4 │ │ │ │ .INDENT 0.0 │ │ │ │ .IP \(bu 2 │ │ │ │ @@ -4286,20 +4286,20 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .IP \(bu 2 │ │ │ │ \fI\%mp_version()\fP, \fI\%mpc_version()\fP, and \fI\%mpfr_version()\fP now return normal │ │ │ │ strings on Python 2.x instead of Unicode strings. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Fix warnings when shifting 32\-bit integer by 32 bits. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Faster conversion of the standard library \X'tty: link https://docs.python.org/3/library/fractions.html#fractions.Fraction'\fI\%Fraction\fP\X'tty: link' type │ │ │ │ +Faster conversion of the standard library \fBFraction\fP type │ │ │ │ to \fI\%mpq\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Improved conversion of the \X'tty: link https://docs.python.org/3/library/decimal.html#decimal.Decimal'\fI\%Decimal\fP\X'tty: link' type to \fI\%mpfr\fP\&. (casevh) │ │ │ │ +Improved conversion of the \fBDecimal\fP type to \fI\%mpfr\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Consistently return \X'tty: link https://docs.python.org/3/library/exceptions.html#OverflowError'\fI\%OverflowError\fP\X'tty: link' when converting \fBinf\fP\&. (casevh) │ │ │ │ +Consistently return \fBOverflowError\fP when converting \fBinf\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Fix \fI\%mpz.__format__()\fP when the format code includes \(dq#\(dq. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Add \fI\%is_infinite()\fP and deprecate \fBis_inf()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Add \fI\%is_finite()\fP and deprecate \fBis_number()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ @@ -4308,35 +4308,35 @@ │ │ │ │ Fixed error handling with mpc(); mpc(1,\(dqnan\(dq) is properly handled. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Added caching for \fI\%mpc\fP objects. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Faster code path for basic operation is both operands are \fI\%mpfr\fP │ │ │ │ or \fI\%mpc\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Fix \fI\%mpfr\fP + \X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link' segmentation fault. (casevh) │ │ │ │ +Fix \fI\%mpfr\fP + \fBfloat\fP segmentation fault. (casevh) │ │ │ │ .UNINDENT │ │ │ │ .SS Changes in gmpy2 2.0.0b2 │ │ │ │ .INDENT 0.0 │ │ │ │ .IP \(bu 2 │ │ │ │ Allow \fI\%xmpz\fP slice assignment to increase length of \fI\%xmpz\fP instance by │ │ │ │ specifying a value for stop. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Fixed reference counting bug in several \fBis_xxx_prp()\fP tests. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Added \fI\%iter_bits()\fP, \fI\%iter_clear()\fP, \fI\%iter_set()\fP methods │ │ │ │ to \fI\%xmpz\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Added \fI\%powmod()\fP for easy access to three argument \X'tty: link https://docs.python.org/3/library/functions.html#pow'\fI\%pow()\fP\X'tty: link'\&. (casevh) │ │ │ │ +Added \fI\%powmod()\fP for easy access to three argument \fBpow()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Removed \fBaddmul()\fP and \fBsubmul()\fP which were added in 2.0.0b1 since they │ │ │ │ are slower than just using Python code. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Bug fix in gcd_ext when both arguments are not \fI\%mpz\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ -Added \fI\%ieee()\fP to create contexts for 32, 64, or 128 bit \X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link'\(aqs. (casevh) │ │ │ │ +Added \fI\%ieee()\fP to create contexts for 32, 64, or 128 bit \fBfloat\fP\(aqs. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Bug fix in \fI\%context()\fP not setting \fI\%emax\fP/\fI\%emin\fP correctly │ │ │ │ if they had been changed earlier. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Contexts can be directly used in with statement without requiring │ │ │ │ \fI\%set_context()\fP/\fI\%local_context()\fP sequence. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ @@ -4346,15 +4346,15 @@ │ │ │ │ .INDENT 0.0 │ │ │ │ .IP \(bu 2 │ │ │ │ Rename to gmpy2 to allow backwards incompatible changes (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Renamed \(aqmpf\(aq to \(aqmpfr\(aq to reflect use of MPFR (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Renamed functions that manipulate individual bits to \fBbit_XXX()\fP to align │ │ │ │ -with \X'tty: link https://docs.python.org/3/library/stdtypes.html#int.bit_length'\fI\%bit_length()\fP\X'tty: link'\&. │ │ │ │ +with \fBbit_length()\fP\&. │ │ │ │ .IP \(bu 2 │ │ │ │ Added caching for \fI\%mpq\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Added \fBrootrem()\fP, \fI\%fib2()\fP, \fI\%lucas()\fP, \fI\%lucas2()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Support changed hash function in Python 3.2. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ @@ -4387,16 +4387,16 @@ │ │ │ │ .IP \(bu 2 │ │ │ │ Removed most instance methods in favor of gmpy2.function. The general │ │ │ │ guideline is that \fIproperties\fP of an instance can be done via instance │ │ │ │ methods but \fIfunctions\fP that return a new result are done using │ │ │ │ gmpy2.function. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Added \fB__ceil__()\fP, \fB__floor__()\fP, and \fB__trunc__()\fP methods since they │ │ │ │ -are called by \X'tty: link https://docs.python.org/3/library/math.html#math.ceil'\fI\%math.ceil()\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/math.html#math.floor'\fI\%math.floor()\fP\X'tty: link', and │ │ │ │ -\X'tty: link https://docs.python.org/3/library/math.html#math.trunc'\fI\%math.trunc()\fP\X'tty: link'\&. (casevh) │ │ │ │ +are called by \fBmath.ceil()\fP, \fBmath.floor()\fP, and │ │ │ │ +\fBmath.trunc()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Removed \fBgmpy2.pow()\fP to avoid conflicts. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Removed \fBgmpy2._copy()\fP and added \fI\%xmpz.copy()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Added support for \fB__format__()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ @@ -4428,15 +4428,15 @@ │ │ │ │ Added \fBaddmul()\fP and \fBsubmul()\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Added \fB__round__()\fP, \fI\%round2()\fP, \fI\%round_away()\fP for \fI\%mpfr\fP\&. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ \fBround()\fP is no longer a module level function. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Renamed module functions \fBmin()/max()\fP to \fBmin2()/max2()\fP\&. (casevh) │ │ │ │ -No longer conflicts with builtin \X'tty: link https://docs.python.org/3/library/functions.html#min'\fI\%min()\fP\X'tty: link' and \X'tty: link https://docs.python.org/3/library/functions.html#max'\fI\%max()\fP\X'tty: link' │ │ │ │ +No longer conflicts with builtin \fBmin()\fP and \fBmax()\fP │ │ │ │ .IP \(bu 2 │ │ │ │ Removed \fBset_debug()\fP and related functionality. (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Removed mpf.setprec(), use mpf.round() (casevh) │ │ │ │ .IP \(bu 2 │ │ │ │ Fix test compatibility with Python 3.1.2 and 3.2 (casevh) │ │ │ │ .IP \(bu 2