src/NeinMath/Integer.cs
/// <summary>
/// Subtracts an Integer from another Integer.
/// </summary>
/// <param name="right">The value to subtract.</param>
/// <returns>
/// The result of subtracting right from the Integer.
/// </returns>
Subtracts an Integer from another Integer.
Subtracts an Integer from another Integer .
public Integer Subtract(Integer right)
        {
            if (right.length == 0)
                return Plus();
            if (sign != right.sign)
                return Add(right.Negate());
            var diff = Bits.Compare(bits, length, right.bits, right.length);
            var result = diff < 0
                ? Calc.Subtract(right.bits, right.length, bits, length)
                : Calc.Subtract(bits, length, right.bits, right.length);
            return new Integer(result, result.Length, diff < 0 ? !sign : sign);
        }
public Integer Subtract ( Integer right ) { if ( right . length == 0 ) return Plus ( ) ; if ( sign != right . sign ) return Add ( right . Negate ( ) ) ; var diff = Bits . Compare ( bits , length , right . bits , right . length ) ; var result = diff < 0 ? Calc . Subtract ( right . bits , right . length , bits , length ) : Calc . Subtract ( bits , length , right . bits , right . length ) ; return new Integer ( result , result . Length , diff < 0 ? ! sign : sign ) ; }
Subtracts an Integer from another Integer.
Subtracts an Integer from another Integer .
The result of subtracting right from the Integer.
The result of subtracting right from the Integer .
right
Integer
The value to subtract.
The value to subtract .