egg-polynomial-alejandrolf
v1.0.2
Published
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.
Downloads
1
Readme
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");