On 16-Nov-09 13:13:27, Liviu Andronic wrote:
> On 11/16/09, Ted Harding wrote:
>> Not in this case (see below), though of course in general "-" takes
>> precedence over "^", so, for example, in the expression
>>
>> -2^(1/3)
>>
>> the "-" is applied first, giving (-2); and then "^" is applied
>
Hi
r-help-boun...@r-project.org napsal dne 16.11.2009 13:55:30:
>
> On 16-Nov-09 11:40:29, Petr PIKAL wrote:
> > Hi
> > AFAIK, this is issue of the preference of operators.
> >
> > r-help-boun...@r-project.org napsal dne 16.11.2009 11:24:59:
> >
>
> Not in this case (see below), though of co
Hi
r-help-boun...@r-project.org napsal dne 16.11.2009 13:27:03:
> but with complex, I get complex numbers for the first and last elements:
>
> > (as.complex(tmp))^(1/3)
> [1] 0.01969170+0.03410703i 0.03478442+0.i 0.03285672+0.i
> [4] 0.08950802+0.i 0.05848363+0.10129661i
Hi,
You forgot to put the parenthesis in the way Petr told you :
(-6.108576e-05)^(1/3) and the result is NaN. What do you want to preserve?
Alain
carol white wrote:
but with complex, I get complex numbers for the first and last elements:
(as.complex(tmp))^(1/3)
[1] 0.01969170
On 11/16/09, Ted Harding wrote:
> Not in this case (see below), though of course in general "-" takes
> precedence over "^", so, for example, in the expression
>
> -2^(1/3)
>
> the "-" is applied first, giving (-2); and then "^" is applied
> next, giving (-2)^(1/3). There is a work-round (see
On 16-Nov-09 11:40:29, Petr PIKAL wrote:
> Hi
> AFAIK, this is issue of the preference of operators.
>
> r-help-boun...@r-project.org napsal dne 16.11.2009 11:24:59:
>
Not in this case (see below), though of course in general "-" takes
precedence over "^", so, for example, in the expression
but with complex, I get complex numbers for the first and last elements:
> (as.complex(tmp))^(1/3)
[1] 0.01969170+0.03410703i 0.03478442+0.i 0.03285672+0.i
[4] 0.08950802+0.i 0.05848363+0.10129661i
whereas for the first element, we get the followings.
Moreover,
> -6.1085
Hi
AFAIK, this is issue of the preference of operators.
r-help-boun...@r-project.org napsal dne 16.11.2009 11:24:59:
> Hi,
> I want to apply ^ operator to a vector but it is applied to some of the
> elements correctly and to some others, it generates NaN. Why is it not
able to
> calculate -6.
8 matches
Mail list logo