evaluateAt(a /*int*/) {
        if (a === 0) {
            // Just return the x^0 coefficient
            return this.getCoefficient(0);
        }
        const coefficients = this.coefficients;
        let result;
        if (a === 1) {
            // Just the sum of the coefficients
            result = 0;
            for (let i = 0, length = coefficients.length; i !== length; i++) {
                const coefficient = coefficients[i];
                result = AbstractGenericGF.addOrSubtract(result, coefficient);
            }
            return result;
        }
        result = coefficients[0];
        const size = coefficients.length;
        const field = this.field;
        for (let i = 1; i < size; i++) {
            result = AbstractGenericGF.addOrSubtract(field.multiply(a, result), coefficients[i]);
        }
        return result;
    }
/**
     * @return evaluation of this polynomial at a given point
     */
@return evaluation of this polynomial at a given point
@return evaluation of this polynomial at a given point
evaluateAt(a ) {
        if (a === 0) {
            return this.getCoefficient(0);
        }
        const coefficients = this.coefficients;
        let result;
        if (a === 1) {
            result = 0;
            for (let i = 0, length = coefficients.length; i !== length; i++) {
                const coefficient = coefficients[i];
                result = AbstractGenericGF.addOrSubtract(result, coefficient);
            }
            return result;
        }
        result = coefficients[0];
        const size = coefficients.length;
        const field = this.field;
        for (let i = 1; i < size; i++) {
            result = AbstractGenericGF.addOrSubtract(field.multiply(a, result), coefficients[i]);
        }
        return result;
    }
evaluateAt ( a ) { if ( a === 0 ) { return this . getCoefficient ( 0 ) ; } const coefficients = this . coefficients ; let result ; if ( a === 1 ) { result = 0 ; for ( let i = 0 , length = coefficients . length ; i !== length ; i ++ ) { const coefficient = coefficients [ i ] ; result = AbstractGenericGF . addOrSubtract ( result , coefficient ) ; } return result ; } result = coefficients [ 0 ] ; const size = coefficients . length ; const field = this . field ; for ( let i = 1 ; i < size ; i ++ ) { result = AbstractGenericGF . addOrSubtract ( field . multiply ( a , result ) , coefficients [ i ] ) ; } return result ; }
@return evaluation of this polynomial at a given point
@return evaluation of this polynomial at a given point
/*int*/ // Just return the x^0 coefficient // Just the sum of the coefficients