// float_types.cpp
#include <iostream>
#include <cfloat> // cfloat is a header file containing
// the constants FLT_MAX, etc., which tell us
// the most extreme possible values of the
// floating-point data types.
int main() {
cout << "Sizes and extreme positive values of"
<< " the floating point data types:"
<< endl << endl;
int FLOAT_SIZE = sizeof(float); // how many bytes in a float
cout << " float: " << FLOAT_SIZE << " bytes = "
<< (8 * FLOAT_SIZE) << " bits" << endl;
cout << " Maximum positive value = " << FLT_MAX << endl;
cout << " Minimum positive value = " << FLT_MIN << endl << endl;
int DBL_SIZE = sizeof(double); // how many bytes in a double
cout << " double: " << DBL_SIZE << " bytes = "
<< (8 * DBL_SIZE) << " bits" << endl;
cout << " Maximum positive value = " << DBL_MAX << endl;
cout << " Minimum positive value = " << DBL_MIN << endl << endl;
int LDBL_SIZE = sizeof(long double); // bytes in long double
cout << " long double: " << LDBL_SIZE << " bytes = "
<< (8 * LDBL_SIZE) << " bits" << endl;
cout << " Maximum positive value = " << LDBL_MAX << endl;
cout << " Minimum positive value = " << LDBL_MIN << endl << endl;
cout << "(The floating point data types also have similar"
<< " negative values and zero.)" << endl;
return 0;
} // function main