Task

Compute the sum and product of an array of integers.




 
{A.serie start end [step]} creates a sequence from start to end with optional step 
{A.new words}              creates an array from a sequence of words
{A.toS array}              creates a sequence from the items of an array 
{long_add x y}             returns the sum of two integers of any size
{long_mult x y}            returns the product of two integers of any size
 
{def A {A.new {S.serie 1 10}}} -> [1,2,3,4,5,6,7,8,9,10]
{+ {A.toS {A}}} -> 55
{* {A.toS {A}}} -> 3628800
 
{def B {A.new {S.serie 1 100}}} -> [1,2,3,4,5,6,7,8,9,10,...,95,96,97,98,99,100]
{S.reduce long_add {A.toS {B}}} -> 5050
{S.reduce long_mult {A.toS {B}}} -> 
9332621544394415268169923885626670049071596826438162146859296389521759999322991
5608941463976156518286253697920827223758251185210916864000000000000000000000000
 