floating point literal
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
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.
You can help to correct and verify the translation. Click here for instructions.
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.
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)
eouEseguiu com menos opcionais ou sinal de mais e não vazio seqüência de dígitos decimais (define expoente)Original:(opcional)eorEfollowed 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,LouFOriginal:(opcional) a suffix type specifier as al,f,LorFThe 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.
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. eouEseguiu com menos opcionais ou sinal de mais e não vazio seqüência de dígitos decimais (define expoente)Original:eorEfollowed 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,LouFOriginal:(opcional) a suffix type specifier as al,f,LorFThe 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.
You can help to correct and verify the translation. Click here for instructions.
- (Sem sufixo) define
doubleOriginal:(no suffix) definesdoubleThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. f FdefinefloatOriginal:f FdefinesfloatThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.l Ldefinelong doubleOriginal:l Ldefineslong doubleThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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.
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×104The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Exemplo
std::cout << 123.456e-67 << '\n'
<< .1E4f << '\n'
<< 58. << '\n'
<< 4e2 << '\n';
Saída:
1.23456e-65
1000
58
400