Arithmetic Operators

Visual Basic 2010 provides some arithmetic operators, listed in Table 4.11.

Table 4.11 Arithmetic Operators

image

The first three operators are self-explanatory, so I would like to focus on the other ones. First, an important consideration should be done on the division operators. As shown in Table 4.11, Visual Basic offers two symbols, the slash (/) and backslash (\). The first one can be used in divisions between floating point numbers (such as Double and Single types), and the second can be used only in divisions between integer numbers. This baclslash is fast when working with integers and truncates the result in case it is ...

Get Visual Basic® 2010 Unleashed 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.