From: "W. James" Date: 2009-12-18T17:30:15+09:00 Subject: Re: Math errors jzakiya wrote: > (-3)**3 => -27 > > (-27)**(1/3.0) give NaN instead of -3 > > All odd roots (1/3,1/5,1/7 etc) of negative numbers should give > negative root values, as above, but ruby (in irb) gives NaN (not a > number), even when I require 'complex' . > > Is this considered an error in Ruby? irb(main):006:0> (-27)**(1/3.0) => NaN irb(main):007:0> -27 ** (1/3.0) => -3.0 irb(main):012:0> RUBY_VERSION => "1.8.7" --