#NEWLINE# def sum_accurately( ctx , terms , check_step = 1 ) : #NEWLINE# #INDENT# s = ctx . zero #NEWLINE# k = 0 #NEWLINE# for term in terms ( ) : #NEWLINE# #INDENT# s += term #NEWLINE# if ( ( not ( k % check_step ) ) and term ) : #NEWLINE# #INDENT# if ( abs ( term ) <= ( 1e-18 * abs ( s ) ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# k += 1 #NEWLINE# #UNINDENT# return s