Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Loading
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 4: Data, Operations, and Built-In Functions
Last change: February 13 2016 18:47:36.
<<PreviousNext>>

Short, UShort, Integer, UInteger, Long, and ULong Types

The Short and UShort type (U for unsigned) use two bytes to store data. These data types are often used for counters, which seldom exceed several thousands. The Integer and UInteger types use four bytes to store data and are commonly used for computations dealing with integer numbers. They are also used as the index for elements in a list. The Long and ULong types use eight bytes to store data. All these data types use exactly the same internal coding scheme to represent numbers, but have different ranges and precisions as the table shows.

When the result of a numeric operation exceeds the capacity that a data type can handle, an overflow error will occur at run time. In those cases in which you are not sure how big an integer number may be, you should use the Long or ULong type to be on the safe side.

Last change: February 13 2016 18:47:37.
<<PreviousNext>>