Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #863 from ahalbert/861
Added method sum() to Range pod
  • Loading branch information
jonathanstowe committed Aug 28, 2016
2 parents b72a2b3 + 8f50e70 commit 5270805
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/Type/Range.pod6
Expand Up @@ -181,4 +181,12 @@ by not actually generating the list if it is not necessary.
Performs the same function as C<Range.list.roll>, but attempts to optimize
by not actually generating the list if it is not necessary.
=head2 method sum
multi method sum() returns Numeric:D
Returns the sum of all elements in the Range. Throws X::Str::Numeric if an element can not be coerced into Numeric.
(1..10).sum #55
=end pod

0 comments on commit 5270805

Please sign in to comment.