Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added method sum() to Range pod
  • Loading branch information
ahalbert committed Aug 28, 2016
1 parent c328b06 commit 8f50e70
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 8f50e70

Please sign in to comment.