src/NeinMath/Integer.cs
/// <summary>
/// Subtracts a signed 32-bit integer from an Integer.
/// </summary>
/// <param name="right">The value to subtract.</param>
/// <returns>
/// The result of subtracting right from the Integer.
/// </returns>
Subtracts a signed 32-bit integer from an Integer.
Subtracts a signed 32 - bit integer from an Integer .
public Integer Subtract(int right)
        {
            if (length == 0)
                return ((Integer)right).Negate();
            if (sign != (right < 0))
                return Negate().Add(right).Negate();
            if (length == 1 && bits[0] < Bits.Abs(right))
                return new Integer(new uint[] { Bits.Abs(right)
                    - bits[0] }, 1, !sign);
            var result = Calc.Subtract(bits, length, Bits.Abs(right));
            return new Integer(result, result.Length, sign);
        }
public Integer Subtract ( int right ) { if ( length == 0 ) return ( ( Integer ) right ) . Negate ( ) ; if ( sign != ( right < 0 ) ) return Negate ( ) . Add ( right ) . Negate ( ) ; if ( length == 1 && bits [ 0 ] < Bits . Abs ( right ) ) return new Integer ( new uint [ ] { Bits . Abs ( right ) - bits [ 0 ] } , 1 , ! sign ) ; var result = Calc . Subtract ( bits , length , Bits . Abs ( right ) ) ; return new Integer ( result , result . Length , sign ) ; }
Subtracts a signed 32-bit integer from an Integer.
Subtracts a signed 32 - bit integer from an Integer .
The result of subtracting right from the Integer.
The result of subtracting right from the Integer .
right
int
The value to subtract.
The value to subtract .