Exemple #1
0
        /// <summary>
        /// The overloading of System.Equals
        /// </summary>
        /// <param name="p">The polynomial given to compare</param>
        /// <returns>The bool of equality</returns>
        public bool Equals(Polynomial p)
        {
            if (p == null)
            {
                return(false);
            }

            return(this.GetCoefficients().SequenceEqual(p.GetCoefficients()));
        }
Exemple #2
0
        /// <summary>
        /// The overloading of System.Equals
        /// </summary>
        /// <param name="obj">The object given to compare</param>
        /// <returns>The bool of equality</returns>
        public override bool Equals(object obj)
        {
            Polynomial p = obj as Polynomial;

            if (p == null)
            {
                return(false);
            }

            return(this.GetCoefficients().SequenceEqual(p.GetCoefficients()));
        }