mplsr

21 Reputation

2 Badges

17 years, 197 days

MaplePrimes Activity


These are replies submitted by mplsr

Sorry, I don't get it . I read (in the Help) that sqrt(b^2) is not simplified because b could be negative. I thought eval(a, b=2) would provide a hint that b is not negative. Why doesn't "a:=sqrt(b^2);eval(a, b=2);" produce the same result for a as "b:=2; a:=sqrt(b^2)"? I thought eval(a, b=2) treats whatever a is defined so far as a function of b and evaluates it. If not, how do I get this effect? Do I have to write a special procedure a:=proc(b); return sqrt(b^2); end proc; a(2); ?
Sorry, I don't get it . I read (in the Help) that sqrt(b^2) is not simplified because b could be negative. I thought eval(a, b=2) would provide a hint that b is not negative. Why doesn't "a:=sqrt(b^2);eval(a, b=2);" produce the same result for a as "b:=2; a:=sqrt(b^2)"? I thought eval(a, b=2) treats whatever a is defined so far as a function of b and evaluates it. If not, how do I get this effect? Do I have to write a special procedure a:=proc(b); return sqrt(b^2); end proc; a(2); ?
Page 1 of 1