Halaman

Minggu, 24 Juli 2011

Delphi Variable sizes

Although we are on a high programming language, the size of variables is very important when you are working with untyped / binary files and also socket programming, here is the basic types and also their sizes
Type  Storage size                        Range            
 
 Byte       1                             0 to 255
 ShortInt   1                          -127 to 127
 Word       2                             0 to 65,535
 SmallInt   2                       -32,768 to 32,767
 LongWord   4                             0 to 4,294,967,295
 Cardinal   4*                            0 to 4,294,967,295
 LongInt    4                -2,147,483,648 to 2,147,483,647
 Integer    4*               -2,147,483,648 to 2,147,483,647
 Int64      8    -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
 
 Single     4     7  significant digits, exponent   -38 to +38
 Currency   8    50+ significant digits, fixed 4 decimal places
 Double     8    15  significant digits, exponent  -308 to +308
 Extended  10    19  significant digits, exponent -4932 to +4932
 
 * Note : the Integer and Cardinal types are both 4 bytes in size at present (Delphi release 7), but are not guaranteed to be this size in the future. All other type sizes are guaranteed.
This table is pasted from the original source at http://www.delphibasics.co.uk/Article.asp?Name=Numbers a great website for leaning delphi language

Have a good and nice day everyone.

I'm trying to leaving my traces for anyone who would venture the world of programming

hehehehe :D

Tidak ada komentar:

Posting Komentar