From: Martin DeMello Date: 2011-05-15T03:12:09+09:00 Subject: Re: Math cube root On Fri, May 13, 2011 at 12:00 AM, Josh Cheek wrote: > On Thu, May 12, 2011 at 10:26 AM, Colin Bartlett wrote: >> which also changes this: >>  (-1) ** (1.0 / 3) #=> NaN >> to: >>  (-1) ** (1.0 / 3) #=> (0.5+0.866025403784439i) >> so we can also get complex roots if we want them! >> >> > Which we don't here, given that the cube root of -1 isn't imaginary :/ Think of -1 in polar form (r exp(i theta)) as 1.exp(i pi), then note that the cube roots are (1 exp (i pi/3)), (1 exp (i 2pi/3)) and (1 exp(i pi)). The principal cube root is the one with the smallest value of theta. martin