1.0.2 • Published 6 years ago

egg-polynomial-alejandrolf v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

EGG Polynomial

Extends EGG with a Polynomial class and overloads '+','-','*' and '/' operators to be able to directly use them with Polynomials. Polynomial objects can be evaluated on certain values and printed on an understandable format.

It also extends '+' and '-' operators for Arrays.

Its use is recommended with IGG syntax as it ensures that operators take arguments in pairs. Everything can still work with EGG syntax but Polynomials shouldn't directly use operators with multiple arguments. For example:

:=(x, Pol(2, 3)),
:=(y, *(3, x, 4))

Should be written as:

:=(x, Pol(2, 3)),
:=(y, *(*(3, x), 4))

In IGG:

var x = Pol(2, 3);
var y = 3 * x * 4

Would work just fine

Installation

npm install egg-polynomial-alejandrolf

Or add it as a dependency to your project

It includes EGG and IGG functionalities. A simple use:

let run = require("egg-polynomial-alejandrolf").igg.runFromFile;
run("your-IGG-program-file");