Programming in C++ Some Integral Types Ty pe Size in Bytes Minimum value Maximum value char -128 127 short 32768 32767 224 32,768 32,767 long 2,147,483,6482147,483647 NOTE: Values given for one machine. Actual sizes are machine-dependent
11 Some Integral Types Type Size in Bytes Minimum Value Maximum Value char 1 -128 127 short 2 -32,768 32,767 int 2 -32,768 32,767 long 4 -2,147,483,648 2,147,483,647 NOTE: Values given for one machine. Actual sizes are machine-dependent
Programming in C++ Data Type bool s domain contains only 2 values, true and false %allowable operation are the logical(!,&&, ID) and relational operations 12
12 Data Type bool ❖ domain contains only 2 values, true and false ❖ allowable operation are the logical ( !, &&, ||) and relational operations
Programming in C++ Exponential (Scientific) Notation 2.7E4 means 27x 104= 2.7000 27000.0 2,7E-4 means27x104= 0002.7 0.00027 13
13 Exponential (Scientific) Notation 2.7E4 means 2.7 x 10 4 = 2.7000 = 27000.0 2.7E-4 means 2.7 x 10 - 4 = 0002.7 = 0.00027
Programming in C++ Floating Point Types Type Size in Bytes Minimum Maximum Positive value Positive value float 3.4E38 3.4E+38 double 8 17E-308 17E+308 long double 10 3.4E-4932 11E+4932 NOTE: Values given for one machine. Actual sizes are machine-dependent. 14
14 Floating Point Types Type Size in Bytes Minimum Maximum Positive Value Positive Value float 4 3.4E-38 3.4E+38 double 8 1.7E-308 1.7E+308 long double 10 3.4E-4932 1.1E+4932 NOTE: Values given for one machine. Actual sizes are machine-dependent
Programming in C++ More about Floating Point Types o floating point constants in C++ like 94. 6 without a suffix are of type double by default o to obtain another floating point type constant a suffix must be used %the suffix F or f denotes float type, as in 94.6F %the suffix L or I denotes long double, as in 94.6L 15
15 More about Floating Point Types ❖ floating point constants in C++ like 94.6 without a suffix are of type double by default ❖ to obtain another floating point type constant a suffix must be used ❖ the suffix F or f denotes float type, as in 94.6F ❖ the suffix L or l denotes long double, as in 94.6L