#NEWLINE# def test_exceptions( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# x = math . exp ( ( - 1000000000 ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . fail ( 'underflowing exp() should not have raised an exception' ) #NEWLINE# #UNINDENT# if ( x != 0 ) : #NEWLINE# #INDENT# self . fail ( 'underflowing exp() should have returned 0' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# x = math . exp ( 1000000000 ) #NEWLINE# #UNINDENT# except OverflowError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( "overflowing exp() didn't trigger OverflowError" ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# x = math . sqrt ( ( - 1.0 ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( "sqrt(-1) didn't raise ValueError" )