Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,2 @@
> [(+)/x%(:x)] ⟨3,1,4,1,5,9⟩
3.833333333333333

View file

@ -0,0 +1,3 @@
create or replace function average(lst) as (
list_sum(lst) / length(lst)
);

View file

@ -21,8 +21,8 @@ extension op
public program()
{
var array := new int[]{1, 2, 3, 4, 5, 6, 7, 8};
console.printLine(
"Arithmetic mean of {",array.asEnumerable(),"} is ",
array.average()).readChar()
var array := new int[]{1, 2, 3, 4, 5, 6, 7, 8};
Console.printLine(
"Arithmetic mean of {",array.asEnumerable(),"} is ",
array.average()).readChar()
}

View file

@ -0,0 +1,4 @@
local function arithmetic_mean(a) return a:reduce(|sum, i| -> sum + i) / #a end
local arrays = { {1, 2, 3, 4, 5}, {} }
for arrays as a do print(arithmetic_mean(a)) end