#NEWLINE# def test_overflow( self ) : #NEWLINE# #INDENT# for dtype in [ 'int32' , 'int64' ] : #NEWLINE# #INDENT# v = np . arange ( 5000000 , dtype = dtype ) #NEWLINE# s = Series ( v ) #NEWLINE# result = s . sum ( skipna = False ) #NEWLINE# self . assertEqual ( int ( result ) , v . sum ( dtype = 'int64' ) ) #NEWLINE# result = s . min ( skipna = False ) #NEWLINE# self . assertEqual ( int ( result ) , 0 ) #NEWLINE# result = s . max ( skipna = False ) #NEWLINE# self . assertEqual ( int ( result ) , v [ ( - 1 ) ] ) #NEWLINE# result = s . sum ( ) #NEWLINE# self . assertEqual ( int ( result ) , v . sum ( dtype = 'int64' ) ) #NEWLINE# result = s . min ( ) #NEWLINE# self . assertEqual ( int ( result ) , 0 ) #NEWLINE# result = s . max ( ) #NEWLINE# self . assertEqual ( int ( result ) , v [ ( - 1 ) ] ) #NEWLINE# #UNINDENT# for dtype in [ 'float32' , 'float64' ] : #NEWLINE# #INDENT# v = np . arange ( 5000000 , dtype = dtype ) #NEWLINE# s = Series ( v ) #NEWLINE# result = s . sum ( skipna = False ) #NEWLINE# self . assertEqual ( result , v . sum ( dtype = dtype ) ) #NEWLINE# result = s . min ( skipna = False ) #NEWLINE# self . assertTrue ( np . allclose ( float ( result ) , 0.0 ) ) #NEWLINE# result = s . max ( skipna = False ) #NEWLINE# self . assertTrue ( np . allclose ( float ( result ) , v [ ( - 1 ) ] ) ) #NEWLINE# result = s . sum ( ) #NEWLINE# self . assertEqual ( result , v . sum ( dtype = dtype ) ) #NEWLINE# result = s . min ( ) #NEWLINE# self . assertTrue ( np . allclose ( float ( result ) , 0.0 ) ) #NEWLINE# result = s . max ( ) #NEWLINE# self . assertTrue ( np . allclose ( float ( result ) , v [ ( - 1 ) ] ) )