![]() If number2 evaluates to zero, the behavior of the Mod operator depends on the data type of the operands: For example, the expression 14 / 4 evaluates to 3.5. The / Operator (Visual Basic) returns the full quotient, including the remainder, as a floating-point number. For example, the expression 14 \ 4 evaluates to 3. ![]() ![]() The \ Operator (Visual Basic) returns the integer quotient of a division. If number1 or number2 evaluates to Nothing, it is treated as zero. The data type of the result is the smallest data type that can hold all possible values that result from division with the data types of number1 and number2. If either number1 or number2 is a floating-point value, the floating-point remainder of the division is returned. Public Module Example Public Sub Main() Console.WriteLine($ " 8 Mod 3 = " ) End Sub End Module ' The example displays the following output: ' 8 Mod 3 = 2 ' -8 Mod 3 = -2 ' 8 Mod -3 = 2 ' -8 Mod -3 = -2 Remarks
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |