parameters: (args)
return_statement: return sum_value
docstring: 并行计算元周率中每个线程执行的分解求和
docstring_summary: 并行计算元周率中每个线程执行的分解求和
docstring_tokens: 并行计算元周率中每个线程执行的分解求和
function: def calc_sum(args):
      '并行计算元周率中每个线程执行的分解求和'
      begin, end = args
      sum_value = Decimal(0.0) 
  
      for i in xrange(begin, end):
          mid = Decimal(i + 0.5) * width
          height = Decimal(4.0) / (Decimal(1.0) + mid * mid)
          sum_value += height
      return sum_value
function_tokens: def calc_sum ( args ) : begin , end = args sum_value = Decimal ( 0.0 ) for i in xrange ( begin , end ) : mid = Decimal ( i + 0.5 ) * width height = Decimal ( 4.0 ) / ( Decimal ( 1.0 ) + mid * mid ) sum_value += height return sum_value