Int64Static: Modulus

Modulus

Calculates the remainder of two 64-bit signed integers.



 Public Function Modulus(
	  ByRef Dividend As Int64,
	  ByRef Divisor As Int64 ) As Int64

Parameters

Dividend
[ByRef] Int64. The value to be divided.
Divisor
[ByRef] Int64. The value to divide by.

Return Values

Int64 -  Returns the remainder portion of the division operation.

Remarks

A modulus operation is used to calculate the remainder of a division operation.

Exceptions

ExceptionCondition
DivideByZeroException Attempt to divide by zero.

Examples

The following code calculates the modulus of two 64-bit integers.

Public Sub Main()
    Dim x As Int64
    Dim y As Int64
    Dim r As Int64
    
    x = CInt64(500)
    y = CInt64(55)
    r = Int64.Modulus(x, y)
    
    Debug.Print CorString.Format("The remainder of {0} / {1} = {2}.", x, y, r)
End Sub

'This code produces the following.
'    The remainder of 500 / 55 = 5.

See Also

Project CorLib Overview

Class Int64Static Overview