private static MixedNumber ConvertMixedNumberToFraction(MixedNumber num)
        {
            if (!num.IsMixedNumber)
            {
                return(num.Clone());
            }

            var result = new MixedNumber();

            result.IsNegative  = num.IsNegative;
            result.WholeNumber = 0;
            result.Numerator   = (num.WholeNumber * num.Denominator) + num.Numerator;
            result.Denominator = num.Denominator;

            return(result);
        }
        public static MixedNumber Subtract(MixedNumber one, MixedNumber two)
        {
            if (one.IsZero && two.IsZero)
            {
                return(MixedNumber.Zero);
            }
            if (one.IsZero)
            {
                var twoDash = two.Clone();
                twoDash.IsNegative = !two.IsNegative;
                return(twoDash);
            }

            if (two.IsZero)
            {
                return(one.Clone());
            }

            var result = new MixedNumber();

            if (one.IsWholeNumber && two.IsWholeNumber)
            {
                var oneWholeNumber = one.IsNegative == true ? -1 * one.WholeNumber : one.WholeNumber;
                var twoWholenumber = two.IsNegative == true ? -1 * two.WholeNumber : two.WholeNumber;

                var wholeNumber = oneWholeNumber - twoWholenumber;

                if (wholeNumber < 0)
                {
                    result.WholeNumber = wholeNumber * -1;
                    result.IsNegative  = true;
                }
                else
                {
                    result.WholeNumber = wholeNumber;
                }

                return(result);
            }

            var x = ConvertMixedNumberToFraction(one);
            var y = ConvertMixedNumberToFraction(two);

            Reduce(x);
            Reduce(y);

            if (x.IsWholeNumber == true)
            {
                x.Numerator   = y.Denominator * x.WholeNumber;
                x.Denominator = y.Denominator;
                x.WholeNumber = 0;
            }
            else if (y.IsWholeNumber == true)
            {
                y.Numerator   = x.Denominator * y.WholeNumber;
                y.Denominator = x.Denominator;
                y.WholeNumber = 0;
            }
            else
            {
                var lcm = LeastCommonMultiple(x.Denominator, y.Denominator);
                MultiplyToNumeratorAndDenominator(x, lcm);
                MultiplyToNumeratorAndDenominator(y, lcm);
            }

            var three      = new MixedNumber();
            var xNumerator = x.IsNegative ? -1 * x.Numerator : x.Numerator;
            var yNumerator = y.IsNegative ? -1 * y.Numerator : y.Numerator;
            var n          = xNumerator - yNumerator;

            if (n == 0)
            {
                return(three);
            }
            else if (n < 0)
            {
                three.IsNegative = true;
                n *= -1;
            }

            three.Numerator   = n;
            three.Denominator = x.Denominator;
            Reduce(three);
            ConvertToMixedNumber(three);

            return(three);
        }