From: Kevin Olbrich Date: 2010-07-13T12:25:54+09:00 Subject: [ruby-core:31234] [Bug #3563] problems with exponentiation, cbrt Bug #3563: problems with exponentiation, cbrt http://redmine.ruby-lang.org/issues/show/3563 Author: Kevin Olbrich Status: Open, Priority: Normal ruby -v: ruby 1.9.2dev (2010-07-02 revision 28524) [i386-darwin9.8.0] # nothing required > (-27)**(Rational(1,3)) #=> (1.5000000000000004+2.598076211353316i) I would expect that this would return -3 > Complex(1.5000000000000004,2.598076211353316)**3 #=> (-27.000000000000007+1.2434497875801753e-14i) I can understand how this might happen given round off errors, but the following identity should be true Math.cbrt(-27) == (-27)**(Rational(1,3)) #=> false Also note that if you do this... > require 'complex' > Math.cbrt(-27) #=> (1.5000000000000004+2.598076211353316i) ---------------------------------------- http://redmine.ruby-lang.org