> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/perl6-rosettacode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/s/sum_digits_of_an_integer.md).

# Sum digits of an integer

This will handle input numbers in any base from 2 to 36. The results are in base 10.

```perl
say Σ $_ for <1 1234 1020304 fe f0e DEADBEEF>;

sub Σ { [+] $^n.comb.map: { :36($_) } }
```

#### Output:

```
1
10
10
29
29
104
```
