floating point literal
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
Virgola mobile letterale definisce in fase di compilazione costante il cui valore è specificato nel file di origine.
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.
Sintassi
A virgola mobile letterali hanno due sintassi. Il primo è costituito dalle seguenti parti:
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.
- sequenza di cifre decimali non vuoto contenenti un carattere punto decimale (definisce 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. - (opzionale)
eoEseguito con meno opzionali o segno più e la sequenza non vuota di cifre decimali (definisce esponente)Original:(opzionale)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. - (opzionale) uno specificatore di tipo suffisso come
l,f,LoFOriginal:(opzionale) 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.
La seconda è costituita dalle seguenti parti:
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.
- sequenza non vuota di cifre decimali (definisce 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. eoEseguito con meno opzionali o segno più e la sequenza non vuota di cifre decimali (definisce esponente)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.- (opzionale) uno specificatore di tipo suffisso come
l,f,LoFOriginal:(opzionale) 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.
Il suffisso specificatore di tipo definisce il tipo effettivo della virgola mobile letterale:
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.
- (Nessun suffisso) definisce
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 FdefiniscefloatOriginal:f FdefinesfloatThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.l Ldefiniscelong 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.
Spiegazione
Una notazione decimale scientifica è utilizzato, il che significa che l'esponente è la potenza di 10 con la quale la multiplied.
è significativo
è significativo
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.
Il significato matematico di
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.
Esempio
std::cout << 123.456e-67 << '\n'
<< .1E4f << '\n'
<< 58. << '\n'
<< 4e2 << '\n';
Output:
1.23456e-65
1000
58
400