Hello once more,
after searching for a function in Maxima which applies a given function n
times to an expression (like nest in Mathematica) which I don't find I tried
to implement it on my own. (If there is a function which do this, I would be
very thankful to know about :)
I've tried it that way:
nest(f,a,b):=block([erg],erg:a, for tmp:0 while tmp<b do (erg:f(erg)),
return(erg);
With a function f(x):=x^2 or something like that it works quite good,
but if I give a function like cos, e.g. nest(cos,%pi/4,20), it never comes
to an end.
I don't understand why it seems to be so complicated to calculate the cosine
but after more than 30 minutes I interrupted the calculation and (after
insert a print in the do loop) and it stops at tmp=16.
Does anybody have an idea why it doesn't work or what to change that it will
work?!
--
View this message in context: http://www.nabble.com/Function-doesn%27t-finish-tf1909002.html#a5225802
Sent from the Maxima forum at Nabble.com.