1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 5 - VB.NET Language and Syntax - Part 2

By Dan Mabbutt, About.com

7 of 10

Examples of the Math Operators

A few examples of the use of math operators:
  • calculating the size and position of windows
  • calculating color values (see the About Visual Basic article, Calculating a Contrasting Color Code
  • calculating indexes in databases and loops

Although it's based on VB 6 rather than VB.NET, you can see how remainder division is used to calculate the row and column position in the About Visual Basic article Programming The Tic Tac Toe Game. A VB.NET version of this program is shown later in this tutorial.

If you do find yourself doing a lot of mathematical programming, you'll discover that the fundamental math functions take just too much time and code to use. Who wants to repeat the calculation of the trigonometry calculation of the square root in your code! Object Oriented Programming to the rescue! The .NET Framework includes the System.Math library so you don't have to and the book's explanation of how to use it is great!

But again, the book is just a little bit incomplete ... see why on the next page.

Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.