Return index of for loop



> 
> Try:
> 
> GivePeriodOfAngle(n0,d):=
>    catch(
>       block([ni:n0],
>           for i thru 200 do if (ni:doubling_map(ni,d))=n0 then throw(i),
>           0 ) )
> 
It is good. Thx
>     But it can be changed to
> 
>     G(n0,d):=
>       block([ni:n0],
>        for i thru 200 do if (ni:doubling_map(ni,d))=n0 then
>     if (ni=n0)then return(i) else
>       return(0));
> 
> 
> This does not do the same thing at all!

You are right

This shows that creating even such simple function  gives (IMHO) many 
unexpected problems ( specific to a language and not descibed in docs). 
Such problems not exist in creating program without function. (:-))

Adam
>  
>                  -s
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima