Probably a No-Brainer

Roger Guay irog at mac.com
Thu Dec 27 14:31:39 EST 2018


You are so clever, Herman! Yes, the idea is to write it out into a field.

This is great for the Taylor series, but how would one generalize this so that we could expand any fctn of x and n in the “genFctn” field into the “expandedFctn” field

Sorry to take up so much of your time.

Thanks,

Roger

> On Dec 27, 2018, at 11:02 AM, hh via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 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
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the Use-livecode mailing list