Пример #1
0
        /// <summary>
        /// Mantissa - Mantissa, Exponent - Exponent
        /// </summary>
        /// <param name="other"></param>
        /// <returns>The resulting OfcNumber</returns>
        public OfcNumber SubtractEach(OfcNumber other)
        {
            var num = this;

            num.Number   -= other.Number * (other.IsNegative ? -1 : 1);
            num.Exponent -= other.Exponent;
            return(num);
        }
Пример #2
0
        /// <summary>
        /// Mantissa + Mantissa, Exponent + Exponent
        /// </summary>
        /// <param name="other"></param>
        /// <returns>The resulting OfcNumber</returns>
        public OfcNumber AddEach(OfcNumber other)
        {
            var num = this;

            num.Number   += other.Number * (other.IsNegative ? -1 : 1);
            num.Exponent += other.Exponent;
            return(num);
        }
Пример #3
0
 public bool Equals(OfcNumber other)
 {
     return(IsNegative == other.IsNegative && Number == other.Number && Exponent == other.Exponent);
 }