Arithmetic Operators

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

Image

TABLE 4.11 Arithmetic Operators

The first three operators are self-explanatory, so I would like to focus on the other ones. As shown in Table 4.11, Visual Basic offers two symbols, the slash (/) and backslash (\), for division. 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. Using the backslash is fast when you’re working with integers and truncates the result in case it is a floating-point number. The backslash accepts ...

Get Visual Basic 2015 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.