Espaces de noms
Variantes

floating point literal

De cppreference.com

<metanoindex/>

 
 
Langage C++
Sujets généraux
Contrôle de flux
Instructions conditionnelles
Instructions d'itération
Instructions de saut
Fonctions
déclaration de fonction
expression lambda
fonction générique
spécificateur inline
spécification d'exception (obsolète)
spécificateur noexcept (C++11)
Exceptions
Espaces de noms
Types
spécificateur decltype (C++11)
Qualificatifs
qualificatifs const et volatile
qualificatifs de stockage
qualificatif constexpr (C++11)
qualificatif auto (C++11)
qualificatif alignas (C++11)
Initialisation
Littéraux
Expressions
opérateurs alternatifs
Utilitaires
Types
déclaration typedef
déclaration d'alias de type (C++11)
attributs (C++11)
Jette
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversions implicites
conversion const_cast
conversion static_cast
conversion dynamic_cast
conversion reinterpret_cast
conversions style C et style fonction
Allocation de mémoire
Classes
Qualificatifs spécifiques aux membres de classe
Fonctions membres spéciales
Modèles
classes génériques
fonctions génériques
spécialisation de modèles
paquets de paramètres (C++11)
Divers
Assembleur
 
Virgule flottante littéral définit une constante de compilation dont la valeur est indiquée dans le fichier source .
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.

Syntaxe

A littéraux à virgule flottante ont deux syntaxes. La première est constituée des parties suivantes:
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.
  • séquence non vide de chiffres décimaux contenant un point décimal (définit significatif)
    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.
  • (en option) e ou E suivi avec moins optionnels ou signe plus et la séquence non vide de chiffres décimaux (définit exposant)
    Original:
    (en option) 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.
  • (en option) un spécificateur de type suffixe comme un l, f, L ou F
    Original:
    (en option) 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.
Le second est constitué des parties suivantes:
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.
  • séquence non vide de chiffres décimaux (définit significatif)
    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 suivi avec moins optionnels ou signe plus et la séquence non vide de chiffres décimaux (définit exposant)
    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.
  • (en option) un spécificateur de type suffixe comme un l, f, L ou F
    Original:
    (en option) 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.
Le type de suffixe spécificateur définit le type réel du littéral à virgule flottante:
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.
  • (Sans suffixe) définit 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 définit 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 définit 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.

Explication

Une notation décimale scientifique est utilisée, ce qui signifie que l'exposant est la puissance de 10 par laquelle l'important est 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.
Au sens mathématique du 123e4 est 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.

Exemple

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

Résultat :

1.23456e-65
1000
58
400