Skip to content

Polynomial (type)

Paul edited this page Nov 24, 2026 · 2 revisions

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} represents cx^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 div
  • Polynomial Polynomial mod

Examples

  • Poly{} represents P(x) = 0
  • Poly{5} represents P(x) = 5
  • Poly{-2 1} represents P(x) = x - 2
  • Poly{-3 -2 1} represents P(x) = x^2 -2x + 3
  • Poly{9 0 -6 2} represents P(x) = 2x^3 -6x^2 + 9

Clone this wiki locally