infusion / Polynomial.js

A JavaScript library to work with polynomials

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better documentation for skew fields, and fields which don't close under all implemented operations

duetosymmetry opened this issue · comments

  1. If we are working in the quaternions ℍ, there are two canonical forms for a polynomial; we could either use the left or right polynomial, i.e. P(x) = ∑ a_k x^k, or P(x) = ∑ x^k b_k. These two differ because ℍ is non-commutative. This subtlety needs to be documented, and ensured that it's implemented consistently throughout, e.g. within toString, toHorner, mul, and eval.
  2. The fields ℚ and ℝ are not closed under the pow operation, but this operation is assumed to be implemented for each field. This needs to be documented.

You are totally right on both points. Did you encounter a problem in the code with respect to non-commutativity or is it just a documentation thing?
When I implemented the lib back then, I saw the problem of this and decided to go with integer exponents only.