YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -18,8 +18,8 @@ extension op
|
|||
^ aSum / aCount.
|
||||
]
|
||||
}
|
||||
public program =
|
||||
public program
|
||||
[
|
||||
var anArray := (1, 2, 3, 4, 5, 6, 7, 8).
|
||||
console printLine("Arithmetic mean of {",anArray,"} is ",anArray average); readChar.
|
||||
].
|
||||
console printLine("Arithmetic mean of {",anArray,"} is ",anArray average); readChar
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
sub avg {
|
||||
@_ or return 0;
|
||||
my $sum = 0;
|
||||
$sum += $_ foreach @_;
|
||||
return $sum/@_;
|
||||
}
|
||||
|
||||
print avg(qw(3 1 4 1 5 9)), "\n";
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
rebol [
|
||||
Title: "Arithmetic Mean (Average)"
|
||||
Author: oofoe
|
||||
Date: 2009-12-11
|
||||
URL: http://rosettacode.org/wiki/Average/Arithmetic_mean
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue