Int64Static: Add

Add

Returns the sum of two Int64 values.



 Public Function Add(
	  ByRef a As Int64,
	  ByRef b As Int64 ) As Int64

Parameters

a
[ByRef] Int64. The first value to be added.
b
[ByRef] Int64. The second value to be added.

Return Values

Int64 -  The sum of a and b.

Examples

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

See Also

Project CorLib Overview

Class Int64Static Overview