#NEWLINE# def i2f( x ) : #NEWLINE# #INDENT# if ( x == 0 ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# if ( x < 0 ) : #NEWLINE# #INDENT# return ( i2f ( ( - x ) ) ^ FLOAT_SIGN ) #NEWLINE# #UNINDENT# shift = ( 24 - x . bit_length ( ) ) #NEWLINE# assert ( shift >= 0 ) #NEWLINE# mantissa = ( x << shift ) #NEWLINE# exponent = ( shift + 127 ) #NEWLINE# return ( ( exponent << 23 ) | mantissa )