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. |
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.
[modifica] 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)
e
oE
seguito con meno opzionali o segno più e la sequenza non vuota di cifre decimali (definisce esponente)Original:(opzionale)e
orE
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. - (opzionale) uno specificatore di tipo suffisso come
l
,f
,L
oF
Original:(opzionale) a suffix type specifier as al
,f
,L
orF
The 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. -
e
oE
seguito con meno opzionali o segno più e la sequenza non vuota di cifre decimali (definisce esponente)Original:e
orE
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. - (opzionale) uno specificatore di tipo suffisso come
l
,f
,L
oF
Original:(opzionale) a suffix type specifier as al
,f
,L
orF
The 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) defines doubleThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. -
f F
definisce floatOriginal:f F
defines floatThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. -
l L
definisce long doubleOriginal:l L
defines long doubleThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
-
[modifica] 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></div>
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.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Esempio
std::cout << 123.456e-67 << '\n' << .1E4f << '\n' << 58. << '\n' << 4e2 << '\n';
Output:
1.23456e-65 1000 58 400