MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: (-8)^(1/3)

"David Park" <djmp at> wrote:
> LuisMa,
> Needs["Miscellaneous`RealOnly`"]
> (-8)^(1/3)
> -2
> Ted Ersek has a nice package on MathSource called SwitchableRealOnly. It
> works somewhat better than RealOnly and also allows you to turn RealOnly
> on and off without having to kill the kernel.

Yes, this is basically the only way that you'll get _literally_
(-8)^(1/3) to return -2. But another option which will work, if
you simply need a real cube root function, is to define your own
function, perhaps named RealCbrt, to be Sign[x]*(Abs[x])^(1/3).
Then RealCbrt[-8] yields -2, as desired.

  David Cantrell

-------------------- http://NewsReader.Com/ --------------------
                    Usenet Newsgroup Service

  • Prev by Date: Re: Solving NL-PDE by (Mathematica) NDSolve?
  • Next by Date: Integration problem / internal error ?
  • Previous by thread: Re: (-8)^(1/3)
  • Next by thread: Solution for coupled PDE via Mathematica