12345678910111213141516171819202122232425 |
- #include <iostream>
- #include <bitset>
- using namespace std;
- int main()
- {
- float a = -0.33333333333; // 1 / 4
- int b = 1092830;
- cout << a << endl;
- float *addr = &a;
- int *int_addr = (int *)addr;
- int a_as_int = *int_addr;
- cout << bitset<32>(a_as_int) << endl;
- cout << 0b01111101 - 127 << endl;
- // cout << bitset<32>(a) << endl;
- // cout << bitset<32>(b) << endl;
- }
|