Espaços nominais
Variantes
Acções

floating point literal

Da cppreference.com
< cpp‎ | language

 
 
Linguagem C + +
Tópicos gerais
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Controle de fluxo
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Declarações execução condicional
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Instruções de iteração
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ir declarações
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declaração da função
lambda declaração da função
modelo de função
linha especificador
especificações de exceção (obsoleta)
noexcept especificador (C++11)
Exceções
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Namespaces
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
Especificadores
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv especificadores
armazenamento duração especificadores
constexpr especificador (C++11)
auto especificador (C++11)
alignas especificador (C++11)
Inicialização
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Literais
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expressões
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
representações alternativas
Utilitários
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
tipo de alias declaração (C++11)
atributos (C++11)
Conversões
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversões implícitas
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
Elenco C-estilo e funcional
Alocação de memória
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classe propriedades específicas de função
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funções membro especiais
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modelos
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
modelo de classe
modelo de função
especialização de modelo
pacotes de parâmetros (C++11)
Diversos
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Assembly embutido
 
Ponto flutuante literal define uma constante em tempo de compilação, cujo valor é especificado no arquivo de origem.
Original:
Floating point literal defines a compile-time constant whose value is specified in the source file.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Sintaxe

A literais de ponto flutuante tem duas sintaxes. A primeira é constituída pelas seguintes partes:
Original:
A floating-point literals have two syntaxes. The first one consists of the following parts:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • seqüência de dígitos decimais não vazio contendo um caractere de ponto decimal (define significativo)
    Original:
    nonempty sequence of decimal digits containing a decimal point character (defines significant)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) e ou E seguiu com menos opcionais ou sinal de mais e não vazio seqüência de dígitos decimais (define expoente)
    Original:
    (opcional) e or E followed with optional minus or plus sign and nonempty sequence of decimal digits (defines exponent)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) um especificador de tipo sufixo como l, f, L ou F
    Original:
    (opcional) a suffix type specifier as a l, f, L or F
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
O segundo consiste nas seguintes partes:
Original:
The second one consists of the following parts:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • seqüência não vazia de dígitos decimais (define significativo)
    Original:
    nonempty sequence of decimal digits (defines significant)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • e ou E seguiu com menos opcionais ou sinal de mais e não vazio seqüência de dígitos decimais (define expoente)
    Original:
    e or E followed with optional minus or plus sign and nonempty sequence of decimal digits (defines exponent)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) um especificador de tipo sufixo como l, f, L ou F
    Original:
    (opcional) a suffix type specifier as a l, f, L or F
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
O sufixo especificador de tipo define o tipo real do literal de ponto flutuante:
Original:
The suffix type specifier defines the actual type of the floating-point literal:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • (Sem sufixo) define double
    Original:
    (no suffix) defines double
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • f F define float
    Original:
    f F defines float
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • l L define long double
    Original:
    l L defines long double
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[editar] Explicação

Uma notação decimal científico é usado, o que significa que o expoente é a potência de 10, através da qual o importante é multiplied.
Original:
A decimal scientific notation is used, meaning that the exponent is the power of 10 by which the significant is multiplied.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O significado matemático de 123e4 é 123 × 10 4 </ sup>
Original:
The mathematical meaning of 123e4 is 123×104
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
</div>

[editar] Exemplo

std::cout << 123.456e-67 << '\n'
          << .1E4f       << '\n'
          << 58.         << '\n'
          << 4e2         << '\n';

Output:

1.23456e-65
1000
58
400