You don't want to compute it but want to write it out into a field?
on mouseUp
put taylorsum(4,"x") into fld "OUT"
end mouseUp
function taylorsum n,x -- n is the degree, x the function argument
put "1" into s -- or: put x &"^0/0!" into s
repeat with i=1 to n
put " + " & x &"^"& i &"/"& i &"!" after s
end repeat
return char 1 to -1 of s
end taylorsum
taylorsum(4,"x") yields --> 1 + x^1/1! + x^2/2! + x^3/3! + x^4/4!
taylorsum(4,"2") yields --> 1 + 2^1/1! + 2^2/2! + 2^3/3! + 2^4/4!
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode