[ruby-cvs:64167] mrkn:r57001 (trunk): array.c, enum.c: change sum algorithm

mrkn at ruby-lang.org mrkn at ruby-lang.org
Tue Dec 6 22:40:32 JST 2016


mrkn	2016-12-06 22:40:31 +0900 (Tue, 06 Dec 2016)

  New Revision: 57001

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57001

  Log:
    array.c, enum.c: change sum algorithm
    
    * array.c (rb_ary_sum): change the algorithm to Kahan-Babuska balancing
      summation to be more precise.
      [Feature #12871] [ruby-core:77771]
    
    * enum.c (sum_iter, enum_sum): ditto.
    
    * test_array.rb, test_enum.rb: add an assertion for the above change.

  Modified files:
    trunk/array.c
    trunk/enum.c
    trunk/test/ruby/test_array.rb
    trunk/test/ruby/test_enum.rb


More information about the ruby-cvs mailing list