#NEWLINE# @ moduledef . function ( 'Float' ) #NEWLINE# def method_Float( self , space , w_arg ) : #NEWLINE# #INDENT# if ( w_arg is space . w_nil ) : #NEWLINE# #INDENT# raise space . error ( space . w_TypeError , "can't convert nil into Float" ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if space . is_kind_of ( w_arg , space . w_float ) : #NEWLINE# #INDENT# return space . newfloat ( space . float_w ( w_arg ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if space . is_kind_of ( w_arg , w_arg . w_string ) : #NEWLINE# #INDENT# string = space . str_w ( w_arg ) . strip ( ' ' ) #NEWLINE# try : #NEWLINE# #INDENT# return space . newfloat ( float ( string ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise space . error ( space . w_ArgumentError , ( 'invalid value for Float(): %s' % string ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return space . convert_type ( w_arg , space . w_float , 'to_f' )