Re: [R] cube root

From: Niels Richard Hansen <Niels.R.Hansen+lists_at_math.ku.dk>
Date: Sat, 16 Apr 2011 22:58:44 -0700

?Syntax for precedence of operators.

On 16/04/11 22.51, Branimir K. Hackenberger wrote:
> This is some interesting:
>
>
>
>> -8^(1/3)
>
> [1] -2
>
>> x=(-8:8)
>
>> y=x^(1/3)
>
>> y
>
> [1] NaN NaN NaN NaN NaN NaN NaN NaN
> 0.000000 1.000000
>
> [11] 1.259921 1.442250 1.587401 1.709976 1.817121 1.912931 2.000000
>
>
>
> So, can anybody explain this?! (Why is x[1]^(1/3)=y[1]=NaN, but
> -8^(1/3)=-2?)
>
>
>
> Thx!!!
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Niels Richard Hansen                     Web:   www.math.ku.dk/~richard	
Associate Professor                      Email: Niels.R.Hansen_at_math.ku.dk
Department of Mathematical Sciences             nielsrichardhansen_at_gmail.com
University of Copenhagen                 Skype: nielsrichardhansen.dk	
Universitetsparken 5                     Phone: +1 510 502 8161	
2100 Copenhagen Ø
Denmark

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 17 Apr 2011 - 06:00:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 17 Apr 2011 - 06:50:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive