fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <float.h>
  4. #include <math.h>
  5.  
  6. void PrintBytes( const float value )
  7. {
  8. const char* const byte = ( const char* )&value ;
  9. for( size_t i = 0 ; i < sizeof( value ) ; i++ )
  10. {
  11. printf( "%02hhx" , byte[i] );
  12. }
  13. }
  14.  
  15. int main(void)
  16. {
  17. float value = FLT_MIN;
  18.  
  19. while( 1 )
  20. {
  21. printf( "%e %d " , value , isnormal( value ) );
  22. PrintBytes( value );
  23. puts( "" );
  24.  
  25. if( !isnormal( value ) )
  26. {
  27. break;
  28. }
  29.  
  30. value /= 2.0F;
  31. }
  32. return 0;
  33. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
1.175494e-38 1 00008000
5.877472e-39 0 00004000