On Wednesday, July 3, 2013 2:05:05 AM UTC-7, Eric Gourgoulhon wrote: > > > > Le mercredi 3 juillet 2013 01:07:35 UTC+2, rjf a écrit : >> >> >> >> Your statement then translates to RPBSRPN(x^2) = abs(x) . >> But then if it ir R+-->R+, the abs() is unnecessary, and RPBSRPN(x^2) = >> x. >> >> > No, the abs is necessary: consider the following function: > f : R --> R+, x |--> RPBSRPN(x^2) > then, for x<0, f(x) = abs(x) = -x. >
If you change the function, sure. If I change the function, say to f:C --> R+ then sqrt( (-i)^2) comes out as abs(i) whatever that might be. Probably 1. > > > Surely you don't believe that sqrt of positive numbers are always >> positive. >> >> > Yes I do: > Then perhaps I should not depend on your personal belief system and point out that using such a simplistic approach would be a disaster for a computer system that does algebra. For fun, I looked at the wikipedia article on the topic. It refers to the *principal square root of a positive number.* It is a relatively simple treatment; using it unaltered as a basis for a computer system in which symbols (and rational powers other than 1/2) exist would be problematical. > although a positive number has two square roots, a positive one and a > negative one, the standard expectation regarding the sqrt function is that > sqrt(x) is THE positive square root of x if x is a positive number. > Hence my initial post in this thread. > If you wish to name your function something other than sqrt, go for it. > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.