Numeric data types

In our previous discussion of data types, we lumped all numeric data together; however, Visual Basic has several numeric data types. The following table lists several of them:

Type Fix/Float Range Required
Memory
Byte Fixed-point 0 to 255 1 byte
Short Fixed-point -32,768 to 32,767 2 bytes
Integer Fixed-point -2,147,483,648 to 2,147,483,647 4 bytes
Long Fixed point -9,223,372,036,854,774,808 to 9,223,372,036,854,774,807 8 bytes
Single precision Floating-point +/- 1.4E-45 to 3.4E38 4 bytes
Double precision Floating-point +/- 4.9E-324 to 1.8E308 8 bytes

Type The name of the data type.

Fix/Float: Indicates whether it is a floating-point or fixed-point number. Floating point numbers have decimal points while fixed point or whole numbers do not.

Range: The maximum and minimum values for each numeric type are shown next. The floating-point ranges are shown in scientific notation. For example, 1.8E308, means 1.8 multiplied by 10 to the 308 power -- an unimaginably large number.

Required memory: The amount of memory required for a number of this type.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.