[ruby-cvs:61727] akr:r54565 (trunk): * array.c (rb_ary_sum): Array#sum is implemented.

akr at ruby-lang.org akr at ruby-lang.org
Wed Apr 13 22:51:53 JST 2016


akr	2016-04-13 22:51:53 +0900 (Wed, 13 Apr 2016)

  New Revision: 54565

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

  Log:
    * array.c (rb_ary_sum): Array#sum is implemented.
      Kahan's compensated summation algorithm for precise sum of float
      numbers is moved from ary_inject_op in enum.c.
    
    * enum.c (ary_inject_op): Don't specialize for float numbers.
    
      [ruby-core:74569] [Feature#12217] proposed by mrkn.

  Modified files:
    trunk/ChangeLog
    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