MathGroup Archive 1998

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

Search the Archive

Re: Re: Very strange Bug !?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13113] Re: [mg13080] Re: Very strange Bug !?
  • From: David Withoff <withoff>
  • Date: Tue, 7 Jul 1998 03:44:17 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

> Try
>   
>               NSolve[x^3 == -1,x]
> 
> you will find that your answer is one of the 3 given. 
> 
> > ... but anyway it is commonly accepted that (-1)^{1/3} is -1 !!!
> 
> I don't thinks so. It is *commonly* accepted that x^3 == -1 has three
> roots, one of which is -1. As for why Mathematica picks the one it did.
> I don't know.

Mathematica picks the principal root, which is defined by choosing the
principal branch of the logarithm in Exp[1/3 Log[-1]]. 

You may also be interested in the Miscellaneous`RealOnly` package, which
redefines (-1)^(1/3) be -1:

In[1]:= Needs["Miscellaneous`RealOnly`"]

In[2]:= (-1)^(1/3)

Out[2]= -1

This choice leads to a rather awkward branch cut structure for the cube
root function in the complex plane, but if you aren't interested in
complex numbers, and you don't need to perform any operations that
might involve complex numbers in intermediate results, this may give
the effect that you want.  The Miscellaneous`RealOnly` package is 
described in the Standard Add-On Packages book, which is available
on-line in the function browser.

Dave Withoff
Wolfram Research


  • Prev by Date: Re: Re: declaring integers
  • Next by Date: Re: processing {x,y,z} data
  • Previous by thread: Very strange Bug !?
  • Next by thread: Re: Very strange Bug !?