Fix documentation typos
This commit is contained in:
parent
4ea92ab854
commit
69f8023848
9 changed files with 29 additions and 29 deletions
2
INSTALL
2
INSTALL
|
|
@ -7,7 +7,7 @@ your distribution's repositories first.
|
|||
Requirements
|
||||
------------
|
||||
|
||||
gmpy2 requires recent versions of GMP, MPFR and MPC. Specfically, gmpy2
|
||||
gmpy2 requires recent versions of GMP, MPFR and MPC. Specifically, gmpy2
|
||||
requires GMP 5.0.0 or later, MPFR 3.1.0 or later, and MPC 1.0.0 or later.
|
||||
|
||||
Quick Instructions
|
||||
|
|
|
|||
4
README
4
README
|
|
@ -5,8 +5,8 @@ gmpy2 provides fast multiple-precision arithmetic to Python. gmpy2 is an
|
|||
optimized C extension that supports the GMP, MPFR, and MPC libraries.
|
||||
|
||||
gmpy2 is based on the original gmpy module. gmpy2 adds support for correctly
|
||||
rounded multiple-precison real (using the MPFR library) and complex (using
|
||||
the MPC library) arthmetic.
|
||||
rounded multiple-precision real (using the MPFR library) and complex (using
|
||||
the MPC library) arithmetic.
|
||||
|
||||
The gmpy2 2.0.x series is a stable version that is only receiving bug fixes.
|
||||
The main development branch (2.1.x) was extensively refactored. The most
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ The xmpz type
|
|||
|
||||
gmpy2 provides access to an experimental integer type called *xmpz*. The
|
||||
*xmpz* type is a mutable integer type. In-place operations (+=, //=, etc.)
|
||||
modify the orignal object and do not create a new object. Instances of
|
||||
modify the original object and do not create a new object. Instances of
|
||||
*xmpz* cannot be used as dictionary keys.
|
||||
|
||||
::
|
||||
|
|
@ -171,7 +171,7 @@ http://www.pseudoprime.com/pseudo.html
|
|||
| a**(n-1) == 1 (mod n)
|
||||
|
||||
**is_fibonacci_prp(...)**
|
||||
is_fibonacci_prp(n,p,q) will return True if *n* is an Fibonacci
|
||||
is_fibonacci_prp(n,p,q) will return True if *n* is a Fibonacci
|
||||
probable prime with parameters (p,q).
|
||||
|
||||
| Assuming:
|
||||
|
|
@ -223,7 +223,7 @@ http://www.pseudoprime.com/pseudo.html
|
|||
| lucasv(p,q,s*(2**t)) == 0 (mod n) for some t, 0 <= t < r
|
||||
|
||||
**is_strong_prp(...)**
|
||||
is_strong_prp(n,a) will return True if *n* is an strong (also known as
|
||||
is_strong_prp(n,a) will return True if *n* is a strong (also known as
|
||||
Miller-Rabin) probable prime to the base a.
|
||||
|
||||
| Assuming:
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ Known issues in gmpy2 2.0.0b4
|
|||
-----------------------------
|
||||
|
||||
* The new test suite (test/runtest.py) is incomplete and some tests fail on
|
||||
Python 2.x due to formating issues.
|
||||
Python 2.x due to formatting issues.
|
||||
|
||||
|
||||
Changes in gmpy2 2.0.0b3
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Multiple-precision Complex
|
|||
|
||||
gmpy2 adds a multiple-precision complex type called *mpc* that is based on the
|
||||
MPC library. The context manager settings for *mpfr* arithmetic are applied to
|
||||
*mpc* arithmetic by default. It is possible to specifiy different precision and
|
||||
*mpc* arithmetic by default. It is possible to specify different precision and
|
||||
rounding modes for both the real and imaginary components of an *mpc*.
|
||||
|
||||
::
|
||||
|
|
@ -77,7 +77,7 @@ mpc Attributes
|
|||
Returns the imaginary component.
|
||||
|
||||
**precision**
|
||||
Returns a 2-tuple containing the the precision of the real and imaginary
|
||||
Returns a 2-tuple containing the precision of the real and imaginary
|
||||
components.
|
||||
|
||||
**rc**
|
||||
|
|
@ -117,7 +117,7 @@ mpc Functions
|
|||
atanh(x) returns the inverse hyperbolic tangent of x.
|
||||
|
||||
**cos(...)**
|
||||
cos(x) seturns the cosine of x.
|
||||
cos(x) returns the cosine of x.
|
||||
|
||||
**cosh(...)**
|
||||
cosh(x) returns the hyperbolic cosine of x.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ rounding modes, and many trigonometric, exponential, and special functions. A
|
|||
behavior of exceptions.
|
||||
|
||||
The default precision of an *mpfr* is 53 bits - the same precision as Python's
|
||||
*float* type. If the precison is changed, then ``mpfr(float('1.2'))`` differs
|
||||
*float* type. If the precision is changed, then ``mpfr(float('1.2'))`` differs
|
||||
from ``mpfr('1.2')``. To take advantage of the higher precision provided by
|
||||
the *mpfr* type, always pass constants as strings.
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ original settings when the block of code exits.
|
|||
``gmpy2.local_context()`` first save the current context and then creates a new
|
||||
context based on a context passed as the first argument, or the current context
|
||||
if no context is passed. The new context is modified if any optional keyword
|
||||
arguments are given. The orginal active context is restored when the block
|
||||
arguments are given. The original active context is restored when the block
|
||||
completes.
|
||||
|
||||
In the following example, the current context is saved by ``gmpy2.local_context()``
|
||||
|
|
@ -315,7 +315,7 @@ mpfr Methods
|
|||
Returns a 2-tuple containing the mantissa and exponent.
|
||||
|
||||
**as_simple_fraction()**
|
||||
Returns an *mpq* containing the simpliest rational value that approximates
|
||||
Returns an *mpq* containing the simplest rational value that approximates
|
||||
the *mpfr* value with an error less than 1/(2**precision).
|
||||
|
||||
**conjugate()**
|
||||
|
|
@ -404,12 +404,12 @@ mpfr Functions
|
|||
current range of emin and emax.
|
||||
|
||||
**const_catalan(...)**
|
||||
const_catalan([precision=0]) returns the catalan constant using the
|
||||
const_catalan([precision=0]) returns the Catalan's constant using the
|
||||
specified precision. If no precision is specified, the default precision
|
||||
is used.
|
||||
|
||||
**const_euler(...)**
|
||||
const_euler([precision=0]) returns the euler constant using the specified
|
||||
const_euler([precision=0]) returns the Euler's constant using the specified
|
||||
precision. If no precision is specified, the default precision is used.
|
||||
|
||||
**const_log2(...)**
|
||||
|
|
@ -425,7 +425,7 @@ mpfr Functions
|
|||
arithmetic.
|
||||
|
||||
**cos(...)**
|
||||
cos(x) seturns the cosine of x. x is measured in radians.
|
||||
cos(x) returns the cosine of x. x is measured in radians.
|
||||
|
||||
**cosh(...)**
|
||||
cosh(x) returns the hyperbolic cosine of x.
|
||||
|
|
@ -480,7 +480,7 @@ mpfr Functions
|
|||
**f2q(...)**
|
||||
f2q(x[,err]) returns the simplest *mpq* approximating x to within relative
|
||||
error err. Default is the precision of x. Uses Stern-Brocot tree to find
|
||||
the simplist approximation. An *mpz* is returned if the the denominator
|
||||
the simplest approximation. An *mpz* is returned if the denominator
|
||||
is 1. If err<0, error sought is 2.0 ** err.
|
||||
|
||||
**factorial(...)**
|
||||
|
|
@ -614,7 +614,7 @@ mpfr Functions
|
|||
**mpfr(...)**
|
||||
mpfr() returns and *mpfr* object set to 0.0.
|
||||
|
||||
mpfr(n[, precison=0]) returns an *mpfr* object after converting a numeric
|
||||
mpfr(n[, precision=0]) returns an *mpfr* object after converting a numeric
|
||||
value n. If no precision, or a precision of 0, is specified; the precision
|
||||
is taken from the current context.
|
||||
|
||||
|
|
@ -622,7 +622,7 @@ mpfr Functions
|
|||
a string 's' made up of digits in the given base, possibly with fractional
|
||||
part (with period as a separator) and/or exponent (with exponent marker
|
||||
'e' for base<=10, else '@'). If no precision, or a precision of 0, is
|
||||
specified; the precison is taken from the current context. The base of the
|
||||
specified; the precision is taken from the current context. The base of the
|
||||
string representation must be 0 or in the interval 2 ... 62. If the base
|
||||
is 0, the leading digits of the string are used to identify the base: 0b
|
||||
implies base=2, 0x implies base=16, otherwise base=10 is assumed.
|
||||
|
|
@ -633,7 +633,7 @@ mpfr Functions
|
|||
from a binary format.
|
||||
|
||||
**mpfr_grandom(...)**
|
||||
mpfr_grandom(random_state) returns two random numbers with gaussian
|
||||
mpfr_grandom(random_state) returns two random numbers with Gaussian
|
||||
distribution. The parameter *random_state* must be created by random_state()
|
||||
first.
|
||||
|
||||
|
|
@ -776,7 +776,7 @@ mpfr Functions
|
|||
yn(x,n) returns the Bessel function of the second kind of order n of x.
|
||||
|
||||
**zero(...)**
|
||||
zero(n) returns an *mpfr* inialized to 0.0 with the same sign as n.
|
||||
zero(n) returns an *mpfr* initialized to 0.0 with the same sign as n.
|
||||
If n is not given, +0.0 is returned.
|
||||
|
||||
**zeta(...)**
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ mpq Attributes
|
|||
--------------
|
||||
|
||||
**denominator**
|
||||
x.denomintor returns the denominator of *x*.
|
||||
x.denominator returns the denominator of *x*.
|
||||
|
||||
**numerator**
|
||||
x.numerator returns the numerator of *x*.
|
||||
|
|
@ -47,7 +47,7 @@ mpq Functions
|
|||
f2q(x[, err]) returns the best *mpq* approximating *x* to within
|
||||
relative error *err*. Default is the precision of *x*. If *x* is not an
|
||||
*mpfr*, it is converted to an *mpfr*. Uses Stern-Brocot tree to find the
|
||||
best approximation. An *mpz* is returned if the the denominator is 1. If
|
||||
best approximation. An *mpz* is returned if the denominator is 1. If
|
||||
*err* < 0, then the relative error sought is 2.0 ** *err*.
|
||||
|
||||
**mpq(...)**
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ mpz Methods
|
|||
**num_digits(...)**
|
||||
x.num_digits([base=10]) returns the length of the string representing
|
||||
the absolute value of *x* in radix *base*. The result is correct if base is
|
||||
a power of 2. For other other bases, the result is usually correct but may
|
||||
a power of 2. For other bases, the result is usually correct but may
|
||||
be 1 too large. *base* can range between 2 and 62, inclusive.
|
||||
|
||||
mpz Functions
|
||||
|
|
@ -284,7 +284,7 @@ mpz Functions
|
|||
not an integer, it will be truncated to an integer.
|
||||
|
||||
mpz(s[, base=0]) returns a new *mpz* object from a string *s* made of
|
||||
digits in the given base. If base = 0, thn binary, octal, or hex Python
|
||||
digits in the given base. If base = 0, then binary, octal, or hex Python
|
||||
strings are recognized by leading 0b, 0o, or 0x characters. Otherwise the
|
||||
string is assumed to be decimal. Values for base can range between 2 and 62.
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ mpz Functions
|
|||
**num_digits(...)**
|
||||
num_digits(x[, base=10]) returns the length of the string representing
|
||||
the absolute value of *x* in radix *base*. The result is correct if base is
|
||||
a power of 2. For other other bases, the result is usually correct but may
|
||||
a power of 2. For other bases, the result is usually correct but may
|
||||
be 1 too large. *base* can range between 2 and 62, inclusive.
|
||||
|
||||
**popcount(...)**
|
||||
|
|
@ -321,7 +321,7 @@ mpz Functions
|
|||
the number of bits with value 1 is infinite so -1 is returned in that case.
|
||||
|
||||
**powmod(...)**
|
||||
powmod(x, y, m) returns (*x* ** *y*) mod *m*. The exponenent *y* can be
|
||||
powmod(x, y, m) returns (*x* ** *y*) mod *m*. The exponent *y* can be
|
||||
negative, and the correct result will be returned if the inverse of *x*
|
||||
mod *m* exists. Otherwise, a ValueError is raised.
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Tutorial
|
|||
--------
|
||||
|
||||
The *mpz* type is compatible with Python's built-in int/long type but is
|
||||
significanly faster for large values. The cutover point for performance varies,
|
||||
significantly faster for large values. The cutover point for performance varies,
|
||||
but can be as low as 20 to 40 digits. A variety of additional integer functions
|
||||
are provided.
|
||||
::
|
||||
|
|
@ -121,7 +121,7 @@ Miscellaneous gmpy2 Functions
|
|||
|
||||
**mp_limbsize(...)**
|
||||
mp_limbsize() returns the number of bits per limb used by the GMP or MPIR
|
||||
libarary.
|
||||
library.
|
||||
|
||||
**mp_version(...)**
|
||||
mp_version() returns the version of the GMP or MPIR library.
|
||||
|
|
|
|||
Loading…
Reference in a new issue