#NEWLINE# @ classmethod #NEWLINE# def eval( cls , z ) : #NEWLINE# #INDENT# if ( z is S . Zero ) : #NEWLINE# #INDENT# return S ( 0 ) #NEWLINE# #UNINDENT# prefact = S . One #NEWLINE# newarg = z #NEWLINE# changed = False #NEWLINE# nz = newarg . extract_multiplicatively ( ( - 1 ) ) #NEWLINE# if ( nz is not None ) : #NEWLINE# #INDENT# prefact = ( - prefact ) #NEWLINE# newarg = nz #NEWLINE# changed = True #NEWLINE# #UNINDENT# nz = newarg . extract_multiplicatively ( I ) #NEWLINE# if ( nz is not None ) : #NEWLINE# #INDENT# prefact = ( ( cls . _sign * I ) * prefact ) #NEWLINE# newarg = nz #NEWLINE# changed = True #NEWLINE# #UNINDENT# if changed : #NEWLINE# #INDENT# return ( prefact * cls ( newarg ) ) #NEWLINE# #UNINDENT# if ( z is S . Infinity ) : #NEWLINE# #INDENT# return S . Half #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( z is ( I * S . Infinity ) ) : #NEWLINE# #INDENT# return ( ( cls . _sign * I ) * S . Half )