Shortint/fr

From Free Pascal wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Deutsch (de) English (en) suomi (fi) français (fr) русский (ru)

Un entier court est un entier signé dans l'intervalle allant de -128 à 127. Sa taille est de 8 bits (1 octet). Contrairement au type Byte qui a aussi une taille de 8 bits, il est signé.

var
  a_shortint: shortint;
  a_byte : byte;
  s1, s2 : string;
begin
  a_shortint := %11110001;   // nombre binaire
  a_byte     := %11110001;
  s1 := IntToStr(a_shortint); // s1 = '-15'
  s2 := IntToStr(a_byte);     // s2 = '241'

Voir aussi

Types de données
Types de données simples Boolean | Byte |Cardinal | Char | Currency | Extended | Int64 | Integer | Longint | Pointer | Real | Shortint | Smallint | Word
Types de données complexes Array | Class | Record | Set | String | ShortString