« Premiers pas en OCaml/Types primitifs » : différence entre les versions

Contenu supprimé Contenu ajouté
Watermy (discussion | contributions)
style + ajout d'info
Watermy (discussion | contributions)
→‎Tableau récapitulatif : + représentation
Ligne 191 :
 
== Tableau récapitulatif ==
{| style="text-align:center" class="wikitable"
|-
! Type !! Signification !! Représentation !! {{Fait}} Exemples !! {{Non}} Erreurs
|-
! int
|| '''int'''Entier || Entier<math>[-2^{30};2^{30}-1]</math> [[w:Architecture_32_bits|[1]]] <br /> ou <br /> <math>[-2^{62};2^{62}-1]</math> [[w:Processeur_64_bits|[2]]]|| -42 <br /> 1337 <br /> 0x539 <br /> 0o2471 <br /> 0b10100111001|| 0x8 : ''non octal'' <br /> 1. : ''mauvais type'' <br /> 1073741824 : ''dépassement entier''
|-
! float
|| '''float'''Réel, flottant || RéelEntre <math>-1,8.10^{308}</math> flottantet <math>1,8.10^{308}</math> || -1. <br /> 13.37 || 0 : ''mauvais type'' <br /> 0,42 : ''pas de virgule'' <br /> 0x1. : ''impossible''
|-
! char
|| '''char''' Caractère || Entre Caractère'\000' et '\255' || 'c' <br /> '\n' <br /> '0' || 'cd' : ''trop de caractères''
|-
! string
| '''string''' || Chaîne de caractère || "chaine de caractere" <br /> "c" <br /> "1337" ||
|| Chaîne de caractères || Tableau de [[w:Mot_%28informatique%29|mots]] de <br /> 4 octets [[w:Architecture_32_bits|[1]]] ou </br> 8 octets [[w:Processeur_64_bits|[2]]] || "chaine de caractères" <br /> "c" <br /> "1337" ||
|-
|! '''bool'''
|| Booléen
| colspan="2" || true <br /> false ||
|-
! unit
| '''unit''' || Unité || () ||
|| Unité
| colspan="2" | () ||
|}