On Thu, May 14, 2009 at 12:34 PM, Jason Grout wrote: >> Bill Page wrote: >> Ok thanks. I recall the discussion and I can indeed write: >> >> sage: f=lambda x:RR(x).nth_root(3) >> sage: f(-2.0) >> -1.25992104989487 >> >> but I think I'll let my earlier comment stand: >> >>>> I think there should be a more obvious way. > > > Of course, you're welcome to suggest a way. Note that in earlier > threads, having a switch that determines which root to pick has > been negatively viewed. >
-1 > What about changing the name of the above function to: > > RR(x).real_root(3) ? > > That would certainly be easier to find and would be a bit more > descriptive. Of course, right now, there is an nth_root function for > complex numbers that also would have to be addressed. > -0 > Or what about making real_root a method for any number (or > real_nth_root, or make nth_root take an argument for a target > domain, like RR or RDF)? > Perhaps we should continue this discussion on sage-devel if there is some reall interest in resolving this issue? What I personally would really prefer is that x^(1/3) call '.nth_root(3)' because (1/3) is an element of Rational Field. I suppose this requires some small change to the coercion system. Then x^(1.0/3.0) or equivalently x^RR(1/3) could continue to behave as it does now. Regards, Bill Page. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---