Releases: yalishanda42/py-polynomial
Releases · yalishanda42/py-polynomial
0.6.2
0.6.1
(+) Implemented __call__
0.6.0
0.5.2
0.5.1
Version 0.5.1
- Made
FrozenPolynomial
andZeroPolynomial
hashable.
Version 0.5.0
New things
- Polynomial division with a remainder with
divmod()
, e.g.
>>> p, r = divmod(Polynomial(1, 2, 3))
>>> p
Polynomial(1, 0)
>>> r
Polynomial(3)
- Floor division support (
//
and//=
) (#24) - Modulo support (
%
and%=
) (#24) **
andpow()
support (#32 )<<
,>>
,<<=
,>>=
support (#31 )- Method that calculates and returns the n-th derivative of the polynomial (
nth_derivative(n)
) - Check if a term or a polynomial's terms all exist in another polynomial with
in
(#27) - Add
FrozenPolynomial
which is immutable (#33)
Fixes things
- Fix
str()
output for terms with degrees with 10 to 19 - Fix #35 - handle degree changes and zero instance operations
- Fix derivative of zero (#17 )
- Fix multiplying by zero (#18 )
- Fix
Constant
to number casts (#16) - Fix default monomial value (#15 )
- Fix bug when setting the leading term to zero (#19)
- Fix
repr()
for Binomial and Trinomial (#38) - Simplified source code: module
polynomial
now divided into the following submodules:core
,binomial
,trinomial
- Optimize addition and multiplication performance (#41)
Again, kudos to @philippeitis for all the hard work!
Version 0.4.1
🎉 KUDOS TO @philippeitis !!! 🍻
New things
- Different
repr()
output. It now shows the code that can reproduce the object instead of a human-friendly informal representation. The latter remains the output ofstr()
(e.g.Polynomial(1, 2, 3)
vsx^2 + 2x + 3
) - Polynomials now support slicing:
p = Polynomial(4,3,2,1,0)
p[:3] == [0, 1, 2]
p[3:] == [3, 4]
p[2:4] = [8, 8] # now p == Polynomial(4, 8, 8, 1, 0)
- Implemented
__neg__
,__pos__
,__sub__
,__rsub__
,__isub__
,__imul__
,__iadd__
.
Fixed things
- Fixed crash when performing multiplication
- Fixed inconsistency and optimized performance when adding polynomials together
- Various other code improvements
Remove package submodule
Changes
- Removed
polynomials
submodule of packagepolynomial
. Now everything is defined inpolynomial
.
0.3.1
New stuff
- Added coefficient getters and setters by letter name convention
ax^n + bx^{n-1} + cx^{n-2} + ... + yx + z
. For example:
p = Polynomial(12, 5, 8, 9)
p.a == p.A == 12 # == p[3]
p.b == p.B == 5 # == p[2]
p.c == p.C == 8 # == p[1]
p.d == p.D == 9 # == p[0]
- Now all classes are within the
polynomials
submodule of thepolynomial
module. - Zero-polynomials's degree is now equal to
-math.inf
instead of-1
Fixed stuff
- Crash related to the fact that the Monomial's degree can only be a natural number
Fix package name
New things
- Fix package name