C# Math DivRem(Int64, Int64, Int64)
Description
Math DivRem(Int64, Int64, Int64)
calculates the quotient
of two 64-bit signed integers and also returns the remainder in an output
parameter.
Syntax
Math.DivRem(Int64, Int64, Int64)
has the following syntax.
public static long DivRem(
long a,/* w w w.j a va2 s. c om*/
long b,
out long result
)
Parameters
Math.DivRem(Int64, Int64, Int64)
has the following parameters.
a
- The dividend.b
- The divisor.result
- The remainder.
Returns
Math.DivRem(Int64, Int64, Int64)
method returns The quotient of the specified numbers.
Example
The following example demonstrates the DivRem(Int64, Int64, Int64) method.
//from w ww .j a v a 2s . co m
using System;
public class Example
{
public static void Main()
{
long remainder;
long quotient = Math.DivRem(1L, 3L, out remainder);
Console.WriteLine(quotient);
Console.WriteLine(remainder);
}
}
The code above generates the following result.