infusion / Polynomial.js

A JavaScript library to work with polynomials

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the 0 polynomial returns undefined when evaluating

Iddoyadlin opened this issue · comments

when I evaluate the 0 polynomial, I get a return value of undefined.
I expect the evaluation in this case to return 0.

Example:

> Polynomial('0').eval(1)
> undefined

Thanks for spotting this error!

hmm no problem. This fixes the case for '0', but it still returns undefined for some polynomials that are identical to 0 (but not 0)

> Polynomial('x-x').eval(1)
< undefined

Thanks for fixing so quickly!

Sorry, fixed again.