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

Contenu supprimé Contenu ajouté
Watermy (discussion | contributions)
+Tableau précision
Watermy (discussion | contributions)
→‎Tableau récapitulatif : - information redondante
Ligne 228 :
 
== Tableau récapitulatif ==
Voir la [[Premiers_pas_en_OCaml/Annexe/Synthèse#Types_primitifs|fiche de synthèse]].
{| style="text-align:center" class="wikitable"
|-
! Type !! Signification !! Représentation !! {{Fait}} Exemples !! {{Non}} Erreurs
|-
! int
|| 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
|| Réel, flottant || Entre <math>-1,8.10^{308}</math> et <math>1,8.10^{308}</math> || -1. <br /> 13.37 || 0 : ''mauvais type'' <br /> 0,42 : ''pas de virgule'' <br /> 0x1. : ''impossible''
|-
! char
|| Caractère || Entre '\000' et '\255' || 'c' <br /> '\n' <br /> '0' || 'cd' : ''trop de caractères''
|-
! string
|| 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é
| colspan="2" | () ||
|}
 
== Références ==