Double Data Type (Visual Basic)
Updated: July 20, 2015
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
Holds signed IEEE 64-bit (8-byte) double-precision floating-point numbers that range in value from -1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values and from 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values. Double-precision numbers store an approximation of a real number.
Double data type provides the largest and smallest possible magnitudes for a number.
The default value of
Double is 0.
Precision. When you work with floating-point numbers, remember that they do not always have a precise representation in memory. This could lead to unexpected results from certain operations, such as value comparison and the
Modoperator. For more information, see Troubleshooting Data Types.
Trailing Zeros. The floating-point data types do not have any internal representation of trailing zero characters. For example, they do not distinguish between 4.2000 and 4.2. Consequently, trailing zero characters do not appear when you display or print floating-point values.
Type Characters. Appending the literal type character
Rto a literal forces it to the
Doubledata type. For example, if an integer value is followed by
R, the value is changed to a
' Visual Basic expands the 4 in the statement Dim dub As Double = 4R to 4.0: Dim dub As Double = 4.0R
Appending the identifier type character
#to any identifier forces it to
Double. In the following example, the variable
numis typed as a
Dim num# = 3
Framework Type. The corresponding type in the .NET Framework is the System.Double structure.