NativeInt: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: NativeInt
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Back to the [[Data type|data types]]. | |
| 2 | + | ||
| 3 | + | Range of values: processor-dependent. Examples for Intel and Intel compatible processors: | |
| 4 | + | ||
| 5 | + | - 32 bit processors: -2,147,483,648 .. 2,147,483,647 | |
| 6 | + | - 64 bit processors: -9,223,372,036,854,775,808 .. 9,223,372,036,854,775,807 | |
| 7 | + | ||
| 8 | + | Memory requirements: processor-dependent. Examples of Intel and Intel compatible processors: | |
| 9 | + | ||
| 10 | + | - 32 bit processors: 4 bytes or 32 bits | |
| 11 | + | - 64 bit processors: 8 bytes or 64 bits | |
| 12 | + | ||
| 13 | + | A data field of the data type **NativeInt** can hold negative and positive [[Integer|integer]] values. Assigning other values leads to compiler error messages when the program is compiled and the compilation process is aborted. That is, the executable program is not created. | |
| 14 | + | ||
| 15 | + | Definition of a data field of the type **NativeInt**: | |
| 16 | + | ||
| 17 | + | ``` pascal | |
| 18 | + | var | |
| 19 | + | nint : NativeInt; | |
| 20 | + | ``` | |
| 21 | + | ||
| 22 | + | Examples of assigning valid values: | |
| 23 | + | ||
| 24 | + | ``` pascal | |
| 25 | + | nint := -2147483648; | |
| 26 | + | nint := 2147483647; | |
| 27 | + | ``` | |
| 28 | + | ||
| 29 | + | Examples of assigning invalid values: | |
| 30 | + | ||
| 31 | + | ``` pascal | |
| 32 | + | nint := '-2147483648'; | |
| 33 | + | nint := '2147483647'; | |
| 34 | + | ``` | |
| 35 | + | ||
| 36 | + | The difference between the two examples is that the upper example is the assignment of literals of the type [[Integer]], while the assignment of the lower example is literals of the type [[String]]. | |
| 37 | + | ||
| 38 | + | --- | |
| 39 | + | *From the Free Pascal wiki, page "NativeInt", as it stood on 2020-02-21 after a change by Trev, 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](/wiki-contact).* |
