Wiki-kopiopeilipalvelin

Tämä on pascal.chatin wikin peilipalvelin. Muokkaus, historia ja kirjautuminen ovat siellä.

Shortint/fi

Deutsch · English · Français · Suomi · Русский

Shortint on etumerkillinen kokonaisluku -128 ja 127 väliltä. Shortint on 8 bittiä pitkä.

Myös byte datatyyppi on 8 bittiä pitkä. Mutta byte datatyyppi on etumerkitön tyyppi ja se merkitsee sitä että se voi esittää numerot 0 ja 255 väliltä.

pascal

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

Katso myös


From the Free Pascal wiki, page "Shortint/fi", as it stood on 2020-01-29 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Versio 1, viimeksi muokannut WikiArchive .