On Thu, May 12, 2011 at 10:26 AM, Colin Bartlett <colinb2r / googlemail.com>wrote:

> On Thu, May 12, 2011 at 2:54 PM, serialhex <serialhex / gmail.com> 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 :/