5 lines
178 B
Text
5 lines
178 B
Text
fcn linearCombination(coeffs){
|
|
[1..].zipWith(fcn(n,c){ if(c==0) "" else "%s*e(%s)".fmt(c,n) },coeffs)
|
|
.filter().concat("+").replace("+-","-").replace("1*","")
|
|
or 0
|
|
}
|