-
Notifications
You must be signed in to change notification settings - Fork 0
/
changes.txt
75 lines (52 loc) · 2.66 KB
/
changes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Changes in gmpy2
1) Support for random number generation has been been removed and will be
replaced with new functions that follow GMP more closely.
2) Support for a mutable integer type - "xmpz" - has been added. A new
option called "prefer_mutable" has been to control the type of the result
in ambiguous cases. By default, mpz + xmpz will return an mpz but if
prefer_mutable is set, the result will be an xmpz.
3) The names of the bit manipulation methods have been changed. They now
begin with "bit_". bit_clear and bit_flip have been added.
4) Support for the different rounding modes for division have been added.
The method names begin with "cdiv" for ceiling divsion, "tdiv" for
truncating division, and "fdiv" for floor division.
5) is_even() and is_odd() were added.
6) "xmpz" supports slicing notation for setting/clearing bits.
7) Various other changes I've forgotten.
Changes in gmpy 1.10
Number conversion rules have changed.
-------------------------------------
The arguments in operations involving mixed types are converted using the
following rules:
Integer --> Rational --> Floating-point
'int' 'Fraction' 'float'
'long' 'mpq' 'Decimal'
'mpz' 'mpf'
Old behavior:
mpz(1) + float(1.2) --> float(2.2)
mpz(1) + Decimal('1.2') --> mpz(2)
New behavior:
mpz(1) + float(1.2) --> mpf(2.2)
mpz(1) + Decimal('1.2') --> mpf(2.2)
As a side-effect of Python 3.x compatibility, coerce() is no longer supported.
The result of // will be an mpz if the arguments are Integer or Rational, but
will be an mpf if either argument is Floating-point.
The result of 'mpq'/'mpq' will be an 'mpq'. It will not be converted to an
'mpf'. This matches the behavior of the 'Fraction' type in Python 3.x.
The result of 'mpz'/'float' will an 'mpf' instead of a 'float'.
Type-specific methods require appropriate arguments.
----------------------------------------------------
If you call an 'mpq' specific method, i.e. gmpy.qdiv, the arguments are
required to be either integer or rational. Floating-point arguments are not
automatically converted to rational when an 'mpq' specific method is
called. Similarly, if you call an 'mpz' specific method, the arguments must
be integers.
Other bug fixes and changes
--------------------------
Corrected formating bug with mpf where last digit was missing.
The wording of some error messages has changed. The type of error has not
changed.
The result of gcdext may no longer be the "minimal" values. They result
does solve gcd(a,b) = ax + by. This is a side-effect of GMP 4.3 using a
different (faster) algorithm.
Unicode strings are now supported.