RosettaCodeData/Task/Cumulative-standard-deviation/Axiom/cumulative-standard-deviation-2.axiom
2023-07-01 13:44:08 -04:00

14 lines
574 B
Text

T ==> Expression Integer
D ==> TestDomain(T)
items := [2,4,4,4,5,5,7,9+x] :: List T;
map(sd, scan(+, items, 0$D))
+---------------+
+-+ +-+ +-+ +-+ | 2
2\|2 \|3 2\|6 4\|6 \|7x + 64x + 256
(1) [0,1,-----,----,-----,1,-----,------------------]
3 2 5 7 8
Type: List(Expression(Integer))
eval subst(last %,x=0)
(2) 2
Type: Expression(Integer)