fork download
  1. #include <iostream>
  2.  
  3. unsigned int mantissa(float x) {
  4. return ((*(unsigned int*)&x << 9) >> 9);
  5. };
  6.  
  7. int main() {
  8. std::cout << mantissa(2.5f) << std::endl;
  9. return 0;
  10. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
2097152