Sign in Join
Wiki copytemporary

Shortint/ru

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

Тип shortint является знаковым целым типом, поддерживающим значения в диапазоне от -128 до 127. Переменная типа shortint занимает 8 бит.

Тип Byte тоже 8-битный, но тип byte является беззнаковым типом. Это означает, что он представляет числа от 0 до 255.

pascal

var
  a_shortint: shortint;
  a_byte : byte;
  s1, s2 : string;
begin
  a_shortint := %11110001;   // двоичное число
  a_byte     := %11110001;
  s1 := IntToStr(a_shortint); // s1 = '-15'
  s2 := IntToStr(a_byte);     // s2 = '241'

См. также


From the Free Pascal wiki, page "Shortint/ru", 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.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 2 people, 2018–2020

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
UseroflazarusCreated page
BartUse pascal highlighter

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.