Différences entre les versions de « Programmation C/Types de base »

Aller à la navigation Aller à la recherche
Balise : Révocation manuelle
! Borne supérieure (formule)
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>signed char</code>
| ≥ 8 bits
| style="background-color:#FFFFFF; text-align: right;" | -128<ref>https://www6.inrae.fr/mia-paris/content/download/4374/41417/version/1/file/Support_cours_MAPC_2016-web-sans-correction.pdf</ref><ref>https://docs.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=vs-2019</ref>
| style="background-color:#FFFFFF; text-align: right;" |-(2<sup>7</sup>-1)
| style="background-color:#FFFFFF; text-align: right;" |+127
| style="background-color:#FFFFFF; text-align: right;" |2<sup>7</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned char</code>
| ≥ 8 bits
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |+255
| style="background-color:#FFFFFF; text-align: right;" |2<sup>8</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>short</code>
| ≥ 16 bits
| style="background-color:#FFFFFF; text-align: right;" | -32 768
| style="background-color:#FFFFFF; text-align: right;" | -(2<sup>15</sup>-1)
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:+32767}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>15</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned short</code>
| ≥ 16 bits
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:+65535}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>16</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>int</code>
| ≥ 16 bits (processeur 16 bits)
≥ 32 bits (processeur 32 bits)<ref name=":0">https://www.commentcamarche.net/contents/121-langage-c-les-types-de-donnees</ref>
| style="background-color:#FFFFFF; text-align: right;" | -32 768
-2 147 483 648
| style="background-color:#FFFFFF; text-align: right;" | -(2<sup>15</sup>)
-(2<sup>31</sup>)
| style="background-color:#FFFFFF; text-align: right;" | +32 767
+2 147 483 647
| style="background-color:#FFFFFF; text-align: right;" |2<sup>15</sup>-1
2<sup>31</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned int</code>
| ≥ 16 bits (processeur 16 bits)
≥ 32 bits (processeur 32 bits)<ref name=":0" />
| style="background-color:#FFFFFF; text-align: right;" |0
0
| style="background-color:#FFFFFF; text-align: right;" |0
0
| style="background-color:#FFFFFF; text-align: right;" | +65 535
+4 294 967 295
| style="background-color:#FFFFFF; text-align: right;" |2<sup>16</sup>-1
2<sup>32</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>long</code>
| ≥ 32 bits
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:-2147483647}}
| style="background-color:#FFFFFF; text-align: right;" | -(2<sup>31</sup>-1)
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:+2147483647}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>31</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned long</code>
| ≥ 32 bits
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:+4294967295}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>32</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>long long</code> ''(C99)''
| ≥ 64 bits
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:-9223372036854775807}}
| style="background-color:#FFFFFF; text-align: right;" | -(2<sup>63</sup>-1)
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:+9223372036854775807}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>63</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned&nbsp;long&nbsp;long</code> ''(C99)''
| ≥ 64 bits
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |{{formatnum:+18446744073709551615}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>64</sup>-1
|}
 
! Borne supérieure (formule)
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>signed char</code>
| style="background-color:#FFFFFF; text-align: right;" |-128
| style="background-color:#FFFFFF; text-align: right;" |-(2<sup>7</sup>)
| style="background-color:#FFFFFF; text-align: right;" |+127
| style="background-color:#FFFFFF; text-align: right;" |2<sup>7</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned char</code>
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |+255
| style="background-color:#FFFFFF; text-align: right;" |2<sup>8</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>short</code>
| style="background-color:#FFFFFF; text-align: right;" |-{{formatnum:32768}}
| style="background-color:#FFFFFF; text-align: right;" |-(2<sup>15</sup>)
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:32767}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>15</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned short</code>
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:65535}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>16</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>int</code>
| style="background-color:#FFFFFF; text-align: right;" |-{{formatnum:32768}}
| style="background-color:#FFFFFF; text-align: right;" |-(2<sup>15</sup>)
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:32767}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>15</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned int</code>
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:65535}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>16</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>long</code>
| style="background-color:#FFFFFF; text-align: right;" |-{{formatnum:2147483648}}
| style="background-color:#FFFFFF; text-align: right;" |-(2<sup>31</sup>)
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:2147483647}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>31</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned long</code>
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:4294967295}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>32</sup>-1
|-----
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>long long</code> ''(C99)''
| style="background-color:#FFFFFF; text-align: right;" |-{{formatnum:9223372036854775808}}
| style="background-color:#FFFFFF; text-align: right;" |-(2<sup>63</sup>)
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:9223372036854775807}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>63</sup>-1
|-
| bgcolorstyle="background-color:#F9F9F9e0e0e040;" |<code>unsigned&nbsp;long&nbsp;long</code> ''(C99)''
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |0
| style="background-color:#FFFFFF; text-align: right;" |+{{formatnum:18446744073709551615}}
| style="background-color:#FFFFFF; text-align: right;" |2<sup>64</sup>-1
|}
 

Menu de navigation