src/NeinMath/IntegerFunctions.cs
/// <summary>
/// Divides an Integer value by another, returns the result, and
/// returns the remainder in an output parameter.
/// </summary>
/// <param name="left">The value to be divided.</param>
/// <param name="right">The value to divide by.</param>
/// <param name="remainder">
/// The remainder that results from the division.
/// </param>
/// <returns>The integral result of the division.</returns>
Divides an Integer value by another, returns the result, and
returns the remainder in an output parameter.
Divides an Integer value by another returns the result and returns the remainder in an output parameter .
public static Integer DivRem(this Integer left, Integer right,
                                     out Integer remainder)
        {
            if (right.length == 0)
                throw new DivideByZeroException();
            if (left.length < right.length)
            {
                remainder = left;
                return new Integer(null, 0, false);
            }
            var remain = default(uint[]);
            var result = Calc.Divide(left.bits, left.length,
                right.bits, right.length, out remain);
            remainder = new Integer(remain, remain.Length, left.sign);
            return new Integer(result, result.Length, left.sign ^ right.sign);
        }
public static Integer DivRem ( this Integer left , Integer right , out Integer remainder ) { if ( right . length == 0 ) throw new DivideByZeroException ( ) ; if ( left . length < right . length ) { remainder = left ; return new Integer ( null , 0 , false ) ; } var remain = default ( uint [ ] ) ; var result = Calc . Divide ( left . bits , left . length , right . bits , right . length , out remain ) ; remainder = new Integer ( remain , remain . Length , left . sign ) ; return new Integer ( result , result . Length , left . sign ^ right . sign ) ; }
Divides an Integer value by another, returns the result, and
returns the remainder in an output parameter.
Divides an Integer value by another returns the result and returns the remainder in an output parameter .
The integral result of the division.
The integral result of the division .
Integer
out
right
Integer
The value to divide by.
The value to divide by .
left
The value to be divided.
The value to be divided .
remainder
The remainder that results from the division.
The remainder that results from the division .