Benford's law: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: oops) |
||
Line 3,039: | Line 3,039: | ||
(formerly Perl 6) |
(formerly Perl 6) |
||
{{Works with|rakudo|2016-10-24}} |
{{Works with|rakudo|2016-10-24}} |
||
<syntaxhighlight lang="raku line |
<syntaxhighlight lang="raku" line>sub benford(@a) { bag +« @a».substr(0,1) } |
||
sub show(%distribution) { |
sub show(%distribution) { |
||
Line 3,077: | Line 3,077: | ||
8: 5.16% | 5.12% | 0.05% |
8: 5.16% | 5.12% | 0.05% |
||
9: 1.88% | 4.58% | 2.70%</pre> |
9: 1.88% | 4.58% | 2.70%</pre> |
||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
The REXX language (for the most part) hasn't any high math functions, so the '''e''', '''ln''', and '''log''' functions were included herein. |
The REXX language (for the most part) hasn't any high math functions, so the '''e''', '''ln''', and '''log''' functions were included herein. |