зеркало из https://github.com/github/ruby.git
* array.c (rb_ary_sum): [DOC] fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f2ee4c7eb0
Коммит
5e08452993
4
array.c
4
array.c
|
@ -5659,7 +5659,7 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
|
||||||
* For example, [e1, e2, e3].sum returns init + e1 + e2 + e3.
|
* For example, [e1, e2, e3].sum returns init + e1 + e2 + e3.
|
||||||
*
|
*
|
||||||
* If a block is given, the block is applied to each element
|
* If a block is given, the block is applied to each element
|
||||||
* before addtion.
|
* before addition.
|
||||||
*
|
*
|
||||||
* If <i>ary</i> is empty, it returns <i>init</i>.
|
* If <i>ary</i> is empty, it returns <i>init</i>.
|
||||||
*
|
*
|
||||||
|
@ -5670,7 +5670,7 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
|
||||||
* [2.5, 3.0].sum(0.0) {|e| e * e } #=> 15.25
|
* [2.5, 3.0].sum(0.0) {|e| e * e } #=> 15.25
|
||||||
* [Object.new].sum #=> TypeError
|
* [Object.new].sum #=> TypeError
|
||||||
*
|
*
|
||||||
* The (arithmetic) mean value of an array can be obtained* as follows.
|
* The (arithmetic) mean value of an array can be obtained as follows.
|
||||||
*
|
*
|
||||||
* mean = ary.sum(0.0) / ary.length
|
* mean = ary.sum(0.0) / ary.length
|
||||||
*
|
*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче