Int64Static: Divide |
Calculates the quotient of two 64-bit signed integers.
Public Function Divide( ByRef Dividend As Int64, ByRef Divisor As Int64 ) As Int64
This method performs integer division, discarding the remainder.
Exception | Condition |
---|---|
DivideByZeroException | Attempt to divide by zero. |
The example demonstrates mathematical operations using Int64.
Public Sub Main() Dim x As Int64 Dim y As Int64 Dim r As Int64 x = CInt64(55) y = CInt64(500) r = Int64.Add(x, y) PrintOutput "+", x, y, r r = Int64.Subtract(x, y) PrintOutput "-", x, y, r r = Int64.Multiply(x, y) PrintOutput "*", x, y, r r = Int64.Divide(y, x) PrintOutput "/", y, x, r End Sub Private Sub PrintOutput(ByVal Op As String, ByRef x As Int64, ByRef y As Int64, ByRef r As Int64) Debug.Print CorString.Format("{1} {0} {2} = {3}", Op, x, y, r) End Sub ' This code produces the following. ' 55 + 500 = 555 ' 55 - 500 = -445 ' 55 * 500 = 27500 ' 500 / 55 = 9