I tried this code to represent float number storing system:
float *f = new float();
int *i = new int();
i = reinterpret_cast<int *>(f);
std::bitset<32> *bs;
std::cin>>*f;
bs = new std::bitset<32>(*i);
std::cout<<*bs<<" == "<<*f<<std::endl;
But when it run with 23.5 the result is 01000001-10111100-00000000-00000000
. The power is 10000001=63
.
Shouldn't it be 64 due to IEEE standard?
And the mantis should be 00010111-10000000-00000000
. Is that true?
Note: I compiled this code with GCC and VS both. The result was same.