Skip to content

Releases: yalishanda42/py-polynomial

0.6.2

10 Dec 13:10
014f5e8
Compare
Choose a tag to compare
  • Add Polynomial.calculate_horner
  • Update CI python version checks: Remove 3.6, 3.7, add 3.8-3.11

0.6.1

20 Jan 18:45
Compare
Choose a tag to compare

(+) Implemented __call__

0.6.0

20 Feb 21:53
Compare
Choose a tag to compare

Implement definite integral (#49)

0.5.2

19 Sep 14:00
4bbdd68
Compare
Choose a tag to compare

Performance improvements (#44 and #45)

0.5.1

10 Apr 21:40
Compare
Choose a tag to compare

Version 0.5.1

  • Made FrozenPolynomial and ZeroPolynomial hashable.

Version 0.5.0

09 Apr 12:37
Compare
Choose a tag to compare

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)
  • ** and pow() 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

18 Mar 23:20
cd587fe
Compare
Choose a tag to compare

🎉 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 of str() (e.g. Polynomial(1, 2, 3) vs x^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

17 Mar 22:41
Compare
Choose a tag to compare

Changes

  • Removed polynomials submodule of package polynomial. Now everything is defined in polynomial.

0.3.1

15 Mar 23:59
Compare
Choose a tag to compare

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 the polynomial 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

15 Mar 20:36
Compare
Choose a tag to compare

New things

  • Fix package name