Ligne 65 : |
Ligne 65 : |
| Don't use a float when an int will do. Don't use an int when a byte will do. Try to use the smallest data type capable of holding the information. | | Don't use a float when an int will do. Don't use an int when a byte will do. Try to use the smallest data type capable of holding the information. |
| | | |
− | xxx
| + | {| class="wikitable" border="1" |
| + | |- |
| + | | align="center" | Types de données |
| + | | align="center" | Taille en octets/Bytes |
| + | | align="center" | Peut contenir: |
| + | |- style="font-size: 90%" |
| + | | align="left" | boolean |
| + | | align="left" | 1 |
| + | | align="left" | true (1, pour ''vrai'') ou false (0, pour ''faux'') |
| + | |- style="font-size: 90%" |
| + | | align="left" | char |
| + | | align="left" | 1 |
| + | | align="left" | Un caractères ASCII ou une valeur signée entre -128 et 127 |
| + | |- style="font-size: 90%" |
| + | | align="left" | unsigned char, byte, uint8_t |
| + | | align="left" | 1 |
| + | | align="left" | Un caractères ASCII ou une valeur '''non signée''' entre 0 et 255 |
| + | |- style="font-size: 90%" |
| + | | align="left" | int, short |
| + | | align="left" | 2 |
| + | | align="left" | Une valeur signée entre -32.768 et 32767. Int est le diminutif de ''Ingeter'' signifiant "Entier". |
| + | |- style="font-size: 90%" |
| + | | align="left" | unsigned int, word, uint16_t |
| + | | align="left" | 2 |
| + | | align="left" | Une valeur '''non signée''' entre 0 et 65535. |
| + | |- style="font-size: 90%" |
| + | | align="left" | long |
| + | | align="left" | 4 |
| + | | align="left" | Une valeur signée entre -2.147.483.648 et 2.147.483.647 |
| + | |- style="font-size: 90%" |
| + | | align="left" | unsigned long, uint32_t |
| + | | align="left" | 4 |
| + | | align="left" | Valeur '''non signée''' entre 0 et 4.294.967.295 |
| + | |- style="font-size: 90%" |
| + | | align="left" | float, double |
| + | | align="left" | 4 |
| + | | align="left" | Une valeur en virgule flottante (''floating point value'' en anglais) dont la valeur est comprise entre -3,4028235E-38 et 3,4028235E+38.<br />Note: Sur cette plateforme, le ''double'' est identique au ''float''). |
| + | |} |
| | | |
| == Pensez globalement. Allouez localement == | | == Pensez globalement. Allouez localement == |