Difference between revisions of "simple type"
From Lazarus wiki
Jump to navigationJump to search (Filled in sizes based upon https://www.freepascal.org/docs-html/ref/refsu4.html) |
(added missing sizes) |
||
Line 37: | Line 37: | ||
| pointer || depends on target cpu bitness: on 32-bit it is 4, on 64-bit it is 8 || | | pointer || depends on target cpu bitness: on 32-bit it is 4, on 64-bit it is 8 || | ||
|- | |- | ||
− | | single || | + | | single || 4 || single precision float |
|- | |- | ||
− | | double || ' | + | | double || 8 (if the system supports this type, otherwise it's an alias for single) || double precision float |
|- | |- | ||
− | | extended || ' | + | | extended || 10 (if the system supports this type, otherwise it's an alias for double) || extended precision float |
|- | |- | ||
− | | [[real]] || | + | | [[real]] || 4 or 8 (platform dependant) || |
|- | |- | ||
− | | currency || | + | | currency || 8 || |
|} | |} | ||
{{Data types}} | {{Data types}} |
Latest revision as of 16:09, 30 January 2023
A simple type is a single value which can be stored in an Identifier. Simple types are predefined by the compiler, but are not reserved words. While it is not recommended, they can be redefined.
Simple types predefined by the compiler are:
name | bytes | comment |
---|---|---|
boolean | 1 | |
cardinal | 4 | |
char | 1 (unless you use {$mode DelphiUnicode} or {$ModeSwitch UnicodeStrings}, then it will be 2) | most likely 1 |
int8 | 1 | by definition |
int16 | 2 | by definition |
int32 | 4 | by definition |
int64 | 8 | by definition |
integer | either 2 or 4, depends on compilation mode | |
shortint | 1 | <= integer |
smallint | 2 | <= integer |
longint | 4 | >= integer |
byte | 1 | by definition |
word | 2 | by definition |
dword | 4 | by definition |
qword | 8 | by definition |
pointer | depends on target cpu bitness: on 32-bit it is 4, on 64-bit it is 8 | |
single | 4 | single precision float |
double | 8 (if the system supports this type, otherwise it's an alias for single) | double precision float |
extended | 10 (if the system supports this type, otherwise it's an alias for double) | extended precision float |
real | 4 or 8 (platform dependant) | |
currency | 8 |
simple data types |
|
---|---|
complex data types |