From: Josh Cheek Date: 2011-05-13T03:30:11+09:00 Subject: Re: Math cube root --000e0cd536224748b304a31860f2 Content-Type: text/plain; charset=ISO-8859-1 On Thu, May 12, 2011 at 10:26 AM, Colin Bartlett wrote: > On Thu, May 12, 2011 at 2:54 PM, serialhex wrote: > > ... > > instead of using floats you can try to use rational numbers in ruby: > > ruby-1.9.2-p180 :001 > require 'mathn' > 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 :/ --000e0cd536224748b304a31860f2--