Difference between revisions of "Data type/ru"

From Free Pascal wiki
Jump to navigationJump to search
Line 12: Line 12:
 
=Целочисленные типы=
 
=Целочисленные типы=
 
==Беззнаковые типы==
 
==Беззнаковые типы==
[[Data field]]s of unsigned integral types can only contain '''positive''' integral numbers.
+
[[Data field|Поля данных]] целых типов без знака могут содержать только «положительные» целые числа.
* [[UInt8]] - Range: (0 .. 255)
+
* [[UInt8]] - Диапазон: (0 .. 255)
* [[Byte]] - Range: (0 .. 255)
+
* [[Byte]] - Диапазон: (0 .. 255)
* [[UInt16]] - Range: (0 .. 65535)
+
* [[UInt16]] - Диапазон: (0 .. 65535)
* [[Word]] - Range: (0 .. 65535)
+
* [[Word]] - Диапазон: (0 .. 65535)
* [[NativeUInt]] - Range: depends on the processor type.
+
* [[NativeUInt]] - Диапазон: зависит от типа процессора.
* [[DWord]] - is equivalent to Longword.
+
* [[DWord]] - эквивалентно Longword.
* [[Cardinal]] - is equivalent to Longword.
+
* [[Cardinal]] - эквивалентно Longword.
* [[UInt32]] - Range: (0 .. 4294967295)
+
* [[UInt32]] - Диапазон: (0 .. 4294967295)
* [[Longword]] - Range: (0 .. 4294967295)
+
* [[Longword]] - Диапазон: (0 .. 4294967295)
* [[UInt64]] - Range:  (0 .. 18446744073709551615)
+
* [[UInt64]] - Диапазон:  (0 .. 18446744073709551615)
* [[QWord]] - Range:  (0 .. 18446744073709551615)
+
* [[QWord]] - Диапазон:  (0 .. 18446744073709551615)
 
<br>
 
<br>
  

Revision as of 00:47, 20 May 2019

Deutsch (de) English (en) español (es) français (fr) Bahasa Indonesia (id) italiano (it) русский (ru)


Общее

На этой странице представлена подборка типов данных в Free Pascal.
Тип данных - это шаблон для поля данных.
Тип данных поля определяет, как компилятор и процессор интерпретируют его содержимое.
Видимость поля данных зависит от местоположения его объявления.

Целочисленные типы

Беззнаковые типы

Поля данных целых типов без знака могут содержать только «положительные» целые числа.

  • UInt8 - Диапазон: (0 .. 255)
  • Byte - Диапазон: (0 .. 255)
  • UInt16 - Диапазон: (0 .. 65535)
  • Word - Диапазон: (0 .. 65535)
  • NativeUInt - Диапазон: зависит от типа процессора.
  • DWord - эквивалентно Longword.
  • Cardinal - эквивалентно Longword.
  • UInt32 - Диапазон: (0 .. 4294967295)
  • Longword - Диапазон: (0 .. 4294967295)
  • UInt64 - Диапазон: (0 .. 18446744073709551615)
  • QWord - Диапазон: (0 .. 18446744073709551615)


Signed types

Data fields of signed integral types can contain positive and negative integral numbers.

  • Int8 - Range: (-128 .. 127)
  • ShortInt - Range: (-128 .. 127)
  • Int16 - Range: (-32768 .. 32767)
  • SmallInt - Range: (-32768 .. 32767)
  • Integer - Range: is equivalent either to Smallint or Longint (for 16 respectively 32 bit processors).
  • Int32 - Range: (-2147483648 .. 2147483647)
  • NativeInt - Range: depends on the processor type.
  • Longint - Range: (-2147483648 .. 2147483647)
  • Int64 - Range: (-9223372036854775808 .. 9223372036854775807)


Floating-point types

Data fields of a floating-point type can contain:

  1. positive and negative integral numbers with possible round-off errors.
  2. positive and negative floating-point numbers.


  • Single - Range: (1.5E-45 .. 3.4E38)
  • Real - Range: depends on the platform.
  • Real48 - Range: 2.9E-39 .. 1.7E38
  • Double - Range: (5.0E-324 .. 1.7E308)
  • Extended - Range: depends on the platform.
  • Comp - Range: (-2E64+1 .. 2E63-1)
  • Currency - Range: (-922337203685477.5808 .. 922337203685477.5807)


Boolean types

Data fields of boolean type contain truth values.

  • Boolean - Range: (True, False), 8 Bit
  • ByteBool - Range: (True, False), 8 Bit
  • WordBool - Range: (True, False), 16 Bit
  • LongBool - Range: (True, False), 32 Bit


Enumeration types

Data fields of an enumeration type are "lists" (enumerations...) of integral unsigned constants.


Char types

Char types with single byte encoding

  • Char - Constant length: 1 byte, representation: 1 character.
  • ShortString - Maxmimum length: 255 characters.
  • String - Maxmimum length: Shortstring or Ansistring (depends in the used compiler switch).
  • PChar - Pointer to a null-terminated string without length restriction.
  • AnsiString - No length restriction.
  • PAnsiChar - Pointer to a null-terminated string without length restriction.

See the overview of the different character and string types.

Char types with multi byte encoding

(The encoding with 2 or 4 bytes is system dependent.

  • WideChar - Constant length: 2 or 4 bytes, representation: 1 character.
  • WideString - No length restriction.
  • PWideChar - Pointer to a null-terminated wide string without length restriction.
  • UnicodeChar - Constant length: 2 or 4 bytes, representation: 1 character.
  • UnicodeString - No length restriction.
  • PUnicodeChar - Pointer to a null-terminated Unicode string without length restriction.

See the overview of the different character and string types.

Variant types


Constants

  • Untyped constants
    • Const - Only simple data types can be used.
  • Typed constants
    • Const - Simple data types as well as records and arrays can be used.
  • Resource Strings
    • Resourcestring - Used for localisation (not available in all compiler modes).


Structural types

  • Array - The size of the array depends on the type and the number of elements it contains.
  • Record - A combination of multiple data types.
  • Set - A set of elements of an ordinal type; the size depends on number of elements it contains.


Subrange types


Pointer

  • Pointer - The size depends on the processor type.


Classes and objects

  • Object - Developed under Turbo Pascal 5.5 for DOS and the precursor of class.
  • Class - Developed under Delphi 1.0 for Windows and the successor of object.