fork download
  1. #include <iostream>
  2. using namespace std;
  3. #include <bitset>
  4.  
  5. float foo(int a)
  6. {
  7. std::cout << std::bitset<32>(a) << endl;
  8. int b;
  9. float *p = (float *)&b;
  10. b = a;
  11. std::cout << std::bitset<32>(*p) << endl;
  12. return *p;
  13. }
  14.  
  15.  
  16.  
  17. int main() {
  18. // your code goes here
  19. cout << foo(1);
  20. return 0;
  21. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
00000000000000000000000000000001
00000000000000000000000000000000
1.4013e-45