#include #include using namespace std; // http://www.who.is.free.fr/wiki/doku.php?id=type // g++ -O0 main.cpp -o main // g++ -O1 main.cpp -o main int main() { cout << hex << std::numeric_limits::max() << endl; // 7fffffff cout << hex << (int32_t) ((float) std::numeric_limits::max()) << endl; // 80000000 cout << hex << (int32_t) (static_cast(std::numeric_limits::max())) << endl; // 80000000 cout << hex << (int32_t) (static_cast(std::numeric_limits::max())) << endl; // 80000000 printf("0x%x\n", (int) (float) 0x80000000); //0x7fffffff } To ExplaiN LimitS CasT * https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html