Skip to content

cube root

6 messages · Branimir K. Hackenberger, Niels Richard Hansen, Berend Hasselman +3 more

#
?Syntax for precedence of operators.
On 16/04/11 22.51, Branimir K. Hackenberger wrote:

  
    
#
Branimir K. Hackenberger wrote:
Operator precedence.

See R FAQ 7.33 Why are powers of negative numbers wrong?


Berend


--
View this message in context: http://r.789695.n4.nabble.com/cube-root-tp3455020p3455027.html
Sent from the R help mailing list archive at Nabble.com.
#
Hey :)

In addition, although (-2)^3 = -8, (-8)^(1/3) != -2, mathematically. A
fractional power of a negative number is complex. And this can be
obtained properly in R:
[1] 1+1.732051i

Cheers,

Tsjerk

  
    
#
Hey :)

In addition, although (-2)^3 = -8, (-8)^(1/3) != -2, mathematically. A
fractional power of a negative number is complex. 

_Not_ in addition. The citation of FAQ 7.33 did not address the correct
issue since the sequence was enclosed in parens. Yours is the only correct
answer. For further discussion about various approaches to fractional powers
of negative numbers one can get further approaches by searching the
archives.
#
On 11-04-17 07:51, Branimir K. Hackenberger wrote:

            
-8^(1/3) == (-8)^(1/3) # NA
-8^(1/3) == -(8^(1/3)) # TRUE
You're welcome.