Linsolve: is it correct?



On September 05, 2008 , Stavros Macrakis wrote:

>> (%i7) fsolve(eqns,vars) := (ratprint:false, float(solve(eqns,vars)) );
>>
> 
> Don't you want to make ratprint local here as you did in your examples
> above?  i.e. block([ratprint:false], ...)
> 
>              -s
>

Thank you for catching this, Stavros.
I meant to make it local and slipped up.

(%i6) fsolve(eqns,vars) := 
         block([ratprint:false], float(solve(eqns,vars)) );
(%o6) fsolve(eqns,vars):=block([ratprint:false],float(solve(eqns,vars)))
(%i7) fsolve(0.9*a - a*x,x);
(%o7) [x = 0.9]
(%i8) fsolve(0.8*x^2 + 2.3*x - 4.3, x);
(%o8) [x = -4.1653941053494,x = 1.2903941053494]
(%i9) ratprint;
(%o9) true

Ted Woollett