3.6. Arithmetic

The arithmetic operators are summarized in Fig. 3.19. The asterisk (*) indicates multiplication, and the keyword Mod represents the Mod operator (also known as the modulus or modulo operator), which will be discussed shortly. Most of the arithmetic operators in Fig. 3.19 are binary operators. For example, the expression sum + value contains the binary operator + and the two operands sum and value. Visual Basic also provides unary operators that take only one operand. For example, unary versions of plus (+) and minus () are provided, so that programmers can write expressions such as +9 and 19.

Figure 3.19. Arithmetic operators.
Visual Basic operationArithmetic operatorAlgebraic expressionVisual Basic expression
Addition+f + 7 ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.