Skip to content

Commit

Permalink
Follow specced MRI behavior for Complex#**(0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Nov 6, 2011
1 parent 6437f5e commit a5bdced
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion kernel/common/complex.rb
Expand Up @@ -187,7 +187,7 @@ def divide(other)
# Raise this complex number to the given (real or complex) power.
#
def ** (other)
if other == 0
if !other.kind_of?(Float) && other == 0
return Complex(1)
end
if other.kind_of?(Complex)
Expand Down
1 change: 0 additions & 1 deletion spec/tags/19/ruby/core/complex/exponent_tags.txt

This file was deleted.

0 comments on commit a5bdced

Please sign in to comment.