Algebra.js
function(poly) {
            var l = Math.max(this.coeffs.length, poly.coeffs.length);
            for(var i=0; i<l; i++) {
                var a = (this.coeffs[i] || new Frac(0)),
                    b = (poly.coeffs[i] || new Frac(0));
                this.coeffs[i] = a.add(b);
            }
            return this;
        }
function(poly) {
            var l = Math.max(this.coeffs.length, poly.coeffs.length);
            for(var i=0; i<l; i++) {
                var a = (this.coeffs[i] || new Frac(0)),
                    b = (poly.coeffs[i] || new Frac(0));
                this.coeffs[i] = a.add(b);
            }
            return this;
        }
function ( poly ) { var l = Math . max ( this . coeffs . length , poly . coeffs . length ) ; for ( var i = 0 ; i < l ; i ++ ) { var a = ( this . coeffs [ i ] || new Frac ( 0 ) ) , b = ( poly . coeffs [ i ] || new Frac ( 0 ) ) ; this . coeffs [ i ] = a . add ( b ) ; } return this ; }
Adds together 2 polynomials
@param {Polynomial} poly
Adds together 2 polynomials