[R] weird behavior with the 3rd root....

Gábor Csárdi csardi.gabor at gmail.com
Sun Oct 26 21:11:26 CET 2008


'^' has higher precedence than '-', i.e. your first line is equivalent to

- ( 0.08xyz..... ^(1/3) )

Gabor

On Sun, Oct 26, 2008 at 9:05 PM, Juan Manuel Barreneche
<jumanbar at gmail.com> wrote:
> Well, this is what i got...
>
>> -0.0841219200008394^(1/3)
> [1] -0.438163696867656
>> (-0.0841219200008394)^(1/3)
> [1] NaN
>
> and i don't have a clue of why this happens or how to avoid it, any suggestions?
>
> thank you,
> Juan
>
> ______________________________________________
> 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.
>



-- 
Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM



More information about the R-help mailing list