Page 247 - Computer_Science_F5
P. 247

Computer Science  Table 4.3:  Integer Data types Storage size  Range
            Type
                                     4 byte
            Integer
                                                    -2,147,483,648 to 2,147,483,647
            Unsigned integer
                                                    0 to 4,294,967,295
                                     4 byte
          FOR ONLINE READING ONLY
            Short integer
            Unsigned short integer   2 bytes        -32,768 to 32,767
                                                    0 to 65,535
                                     2 bytes
            Long integer             4 bytes        -2,147,483,648 to 2,147,483,647
            Unsigned long integer    4 byte         0 to 4,294,967,295


           (b) Character data types
           Character data types comprise alphabetical data. These include char, signed char and
           unsigned char. The classification of character data types with their storage size and
           range of storing data is represented in Table 4.4.


           Table 4.4: Character data types
            Type                     Storage size   Range
            Char                     1 byte         -128 to 127 or 0 to 255
            Signed char              1 byte         -128 to 127
            Unsigned char            1 byte         0 to 255


           (c) Float data types
           Float data types are based on decimal numbers. Float data types include float, double
           and long double. Table 4.5 represents float data types with their storage size and
           range.


           Table 4.5: Float data types
            Type                    Storage size    Range
            Float                   4 bytes         ±3.4E-38 to ±3.4E38

            Double                  8 bytes         ±1.7E-308 to ±1.7E308
            Long double             8 bytes         ±1.7E-308 to ±1.7E308


           (d) Bool data types
           The bool data type has only two values, namely true and false. True and false are
           also called the logical (Boolean) values. The central purpose of this data type is to
           manipulate logical expressions. Use this data type for simple flags that track true/
           false conditions.


                                                 238
                                                                for Advanced Secondary Schools



     Computer Science Form 5.indd   238                                                     23/07/2024   12:33
   242   243   244   245   246   247   248   249   250   251   252