Re: [R] Calculating the power of a negative number

2009-11-17 Thread Peter Dalgaard
Zhiyuan Jason ZHENG wrote: > Hello, > > > > I use R a lot, one thing bugs me is that when I try the following > >> x<- -8 > >> x^(1/3) > > [1] NaN > > > > However, it is fine with -8^(1/3). Priority goes to the power. Can you help > me out for this? Thanks. Well, mycuberoot <- functio

Re: [R] Calculating the power of a negative number

2009-11-17 Thread Colin Millar
-help-boun...@r-project.org] On Behalf Of Colin Millar Sent: 17 November 2009 16:10 To: Zhiyuan Jason ZHENG; r-h...@stat.math.ethz.ch Subject: Re: [R] Calculating the power of a negative number Hi, Look at ?NumericConstants At the bottom of the details section you will find: "Note t

Re: [R] Calculating the power of a negative number

2009-11-17 Thread Colin Millar
this helps, Colin. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Zhiyuan Jason ZHENG Sent: 17 November 2009 14:00 To: r-h...@stat.math.ethz.ch Subject: [R] Calculating the power of a negative number Hello, I use R a lot, one thi

[R] Calculating the power of a negative number

2009-11-17 Thread Zhiyuan Jason ZHENG
Hello, I use R a lot, one thing bugs me is that when I try the following > x<- -8 > x^(1/3) [1] NaN However, it is fine with -8^(1/3). Priority goes to the power. Can you help me out for this? Thanks. Best, Zhiyuan J. ZHENG Ph.D. Candidate Economic Department Virginia Polyte