RosettaCodeData/Task/Averages-Arithmetic-mean/Oforth/averages-arithmetic-mean.fth
2023-07-01 13:44:08 -04:00

4 lines
86 B
Forth

: avg ( x -- avg )
x sum
x size dup ifZero: [ 2drop null ] else: [ >float / ]
;