mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix example code in Array#max doc
`[0, 1, 2, 3].max(6)` actually returns `[3, 2, 1, 0]`, but the doc said it returns `[3, 2, 1]`.
This commit is contained in:
parent
c7601fb9ed
commit
e3e5596782
Notes:
git
2021-05-08 22:41:30 +09:00
1 changed files with 1 additions and 1 deletions
2
array.c
2
array.c
|
@ -5737,7 +5737,7 @@ ary_max_opt_string(VALUE ary, long i, VALUE vmax)
|
|||
* With an argument \Integer +n+ and no block, returns a new \Array with at most +n+ elements,
|
||||
* in descending order per method <tt><=></tt>:
|
||||
* [0, 1, 2, 3].max(3) # => [3, 2, 1]
|
||||
* [0, 1, 2, 3].max(6) # => [3, 2, 1]
|
||||
* [0, 1, 2, 3].max(6) # => [3, 2, 1, 0]
|
||||
*
|
||||
* When a block is given, the block must return an \Integer.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue