Page 12 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 12

Unit 1: Data Structures




          Table 1.3 gives the common sizes of the integer types in C:                           Notes
                            Table 1.3:  Common Sizes of the Integer Types in C

























          The value ranges of integer types can be found in the limits.h header file. This header file
          contains the macros that define minimum and maximum values of each integer type,
          e.g. INT_MIN, INT_MAX for minimum and maximum size of the integer.




              Task  Compare and contrast C signed and unsigned integer types.

          1.2.2 C Float Types

          C provides various floating-point types that represents non-integer number with a decimal
          point at any position.

                 Example: With integer types, you only can have numbers 1, 2, 10, 200… however with
          floating-point type, you can have 1.0, 2.5, 100.25 and so on.
          There are three standard floating-point types in C:

               float: for numbers with single precision.
               double: for numbers with double precision.
               long double: for numbers with extended precision.
          Table 1.4 illustrates the technical attributes of various floating-point types in C. It is important
          to notice that this is only the minimal requirement for storage size defined by C.
                      Table 1.4: Technical Attributes of Various Floating-point Types in C














                                           LOVELY PROFESSIONAL UNIVERSITY                                    5
   7   8   9   10   11   12   13   14   15   16   17