Share via


Tipo de dados duplo (Visual Basic)

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.

Comentários

The Double data type provides the largest and smallest possible magnitudes for a number.

The default value of Double is 0.

Programming Tips

  • Precisão. 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 Mod operator. For more information, see Solucionando problemas de tipos de dados (Visual Basic).

  • 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.

  • Tipo Caracteres. Acrescentando o caractere de tipo literal R para um literal de força para o Double tipo de dados. Por exemplo, se um valor inteiro é seguido por R, o valor é alterado para um Double.

    ' 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. No exemplo a seguir, a variável num é digitado como um Double:

    Dim num# = 3
    
  • Framework Type. O tipo correspondente na.NET Framework é o System.Double estrutura.

Consulte também

Tarefas

Solucionando problemas de tipos de dados (Visual Basic)

Referência

Resumo de tipo de dados (Visual Basic)

System.Double

Tipo de dados decimais (Visual Basic)

Tipo de dados único (Visual Basic)

Funções de conversão de tipo (Visual Basic)

Resumo de conversão (Visual Basic)

Conceitos

Uso eficiente de tipos de dados (Visual Basic)

Caracteres de tipo (Visual Basic)