# Integer

Jump to: navigation, search

Deutsch (de) English (en) suomi (fi) français (fr) italiano (it) русский (ru)

Integer is a standard type of the Pascal Programming language. It is used to define a whole number, as opposed to a real data type (which is used to define a floating point number which may contain a decimal point and possibly an exponent).

The size of an integer is dependent upon the bit size of the target machine to which the compiler is to generate code (32 bit or 64 bit), the type of compiler (16-bit, 32-bit or 64-bit), and upon compiler switches in some cases. Typical sizes of integer generally are

• 16 bit (2 byte)
• 32 bit (4 byte) or
• 64 bit (8 byte)

Currently, the integer type is only dependent on \$mode, not on the CPU type. An integer is 16-bit in TP or FPC modes, or 32-bit in ObjFPC or Delphi modes.

For 64-bit calculation, FPC does support 64-bit Int64 though, which may be defined as a value of -263 through 263-1, or -9 223 372 036 854 775 808 ... 9 223 372 036 854 775 807.

This will cause code expecting an integer and a pointer to be the same size to fail as a 64bit machine uses 64-bit pointers. To allow you to write portable code, the FPC system unit introduces the types PtrInt and PtrUInt which are signed and unsigned integer data types with the same size as a pointer.

On older compilers, an integer was 16 bits, and represented values from -215 through 215-1, or -32 768 through 32 767. A similar data type, word, was sometimes used to define an unsigned integer (0..65 535). In such cases where the compiler used a 16-bit integer type, 32-bit integers would usually be expressed by the long or longint data type.

For x86 machines, an integer is generally defined as 32 bits, and encompasses the values of -231 through 231-1, or -2 147 483 648 .. 2 147 483 647. The latter value is also defined as the constant maxint. The unsigned 32 bit integer type cardinal has a range of 0 through 232-1 or 0 .. 4 294 967 295.

navigation bar: data types
simple data types
complex data types
{"ft_lang_label":"__label__en","ft_lang_prob":0.80350095,"math_prob":0.96076334,"size":2094,"snap":"2019-13-2019-22","text_gpt3_token_len":563,"char_repetition_ratio":0.1291866,"word_repetition_ratio":0.010282776,"special_character_ratio":0.30850047,"punctuation_ratio":0.09862386,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9586674,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-05-22T00:51:42Z\",\"WARC-Record-ID\":\"<urn:uuid:15de8840-46bc-41f8-b666-5e51d88feb49>\",\"Content-Length\":\"22531\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a4c1fba9-993e-4392-b823-9ca55087d169>\",\"WARC-Concurrent-To\":\"<urn:uuid:3b53ee28-f56e-47e6-b993-bc0323e38318>\",\"WARC-IP-Address\":\"193.224.143.39\",\"WARC-Target-URI\":\"http://wiki.freepascal.org/Integer\",\"WARC-Payload-Digest\":\"sha1:PIQZV2IFS6ZAEWMMLTHGX6JPMRGKDN7I\",\"WARC-Block-Digest\":\"sha1:SENHHVSXPMYA7U6PQZG3H6OTUZ3GT7DT\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-22/CC-MAIN-2019-22_segments_1558232256600.32_warc_CC-MAIN-20190522002845-20190522024845-00058.warc.gz\"}"}