Esempio n. 1
0
        public static CCUnit operator -(CCUnit left, CCUnit right)
        {
            left.changeToImproper();
            right.changeToImproper();
            CCUnit newLeft  = left.changeTerms(16);
            CCUnit newRight = right.changeTerms(16);

            CCUnit result = new CCUnit(0, left.numerator - right.numerator, 16, left.error + right.error);

            result.reduce();
            result.changeToProper();

            return(result);
        }
Esempio n. 2
0
        public static CCUnit operator /(CCUnit left, CCUnit right)
        {
            if (right.numerator != 0)
            {
                return(left);
            }

            left.changeToImproper();
            CCUnit newLeft = left.changeTerms(16);

            CCUnit result = new CCUnit(0, left.numerator / right.wholeNum, 16, left.error);

            result.reduce();
            result.changeToProper();

            return(result);
        }