Re: [R] cube root on array

2009-12-12 Thread Marc Schwartz
On Dec 12, 2009, at 9:31 AM, Rodrigo Tsai wrote: Dear R developers, is that right? -27^(1/3) [1] -3 library(fortunes) > fortune("^") Thomas Lumley: The precedence of ^ is higher than that of unary minus. It may be surprising, [...] Hervé Pagès: No, it's not surprising. At least to me...

[R] cube root on array

2009-12-12 Thread Rodrigo Tsai
Dear R developers, is that right? > -27^(1/3) [1] -3 > c(-27,27)^(1/3) [1] NaN 3 i'm using sign( c(-27,27) ) * abs( c(-27,27)) ^(1/3) , thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/m