Hei everyone:

Just see the output of the following program

#include <iostream>

#include <cstdlib>

#include <limits>

int main()

{

std::cout << "minimum exponent of double: " <<

std::numeric_limits<double>::min_exponent

<< "\nmaximum exponent of double: " <<

std::numeric_limits<double>::max_exponent

<< "\nminimum exponent of float: " <<

std::numeric_limits<float>::min_exponent

<< "\nmaximum exponent of float: " <<

std::numeric_limits<float>::max_exponent

<< std::endl;

system("pause");

return 0;

}

I use the vc8 and gcc 3.4 compile it, and the output is the same:

minimum exponent of double: -1021

maximum exponent of double: 1024

minimum exponent of float: -125

maximum exponent of float: 128

but in the IEEE-754(IEEE Standard for Binary Floating-Point

Arithmetic)

the minimum and maximum exponent of double is -1022 and +1023

the minimum and maximum exponent of float is -126 and +127

Why they are not the same?

min_exponent and max_exponent in the <limitsheader are not the same

mean in the IEEE standard?

someone explain it for me??

thanks.