Int64Static: DivRem |
Calculates the quotient of two 64-bit signed integers and also returns the remainder in an output parameter.
Public Function DivRem( ByRef Dividend As Int64, ByRef Divisor As Int64, ByRef Remainder As Int64 ) As Int64
Exception | Condition |
---|---|
DivideByZeroException | Attempt to divide by zero. |
The following code will calculate the quotient and remainder of a division operation.
Public Sub Main() Dim x As Int64 Dim y As Int64 Dim q As Int64 Dim r As Int64 x = CInt64(500) y = CInt64(55) q = Int64.DivRem(x, y, r) Debug.Print CorString.Format("The quotient of {0} / {1} = {2}", x, y, q) Debug.Print CorString.Format("The remainder of {0} / {1} = {2}.", x, y, r) End Sub 'This code produces the following. ' The quotient of 500 / 55 = 9 ' The remainder of 500 / 55 = 5.