Polynomial (type) - MrKaszeba19/PapajLang GitHub Wiki
Polynomial is an entity type used in PapajScript. It stores numerical values.
History
Its debut was on December 14, 2024 along with release of the 0.5.4 version.
Features and notes
- The order of coefficient of Polynomials is ascending, so
Poly{a b c}representscx^2 + bx + a. - The polynomials react to arithmetical operations:
+,-,*,div,mod
Arithmetics
String type supports following artithmetic operations:
Polynomial Polynomial +Polynomial Polynomial -Number Polynomial *Polynomial Polynomial *Polynomial Polynomial divPolynomial Polynomial mod
Examples
Poly{}representsP(x) = 0Poly{5}representsP(x) = 5Poly{-2 1}representsP(x) = x - 2Poly{-3 -2 1}representsP(x) = x^2 -2x + 3Poly{9 0 -6 2}representsP(x) = 2x^3 -6x^2 + 9