Permalink
Browse files

Adding Numeric#to_c

  • Loading branch information...
1 parent b695ebb commit 3fc33fbd1c05682305c8b7f4b55af069daffa6fb @jc00ke jc00ke committed Oct 25, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −0 kernel/common/numeric19.rb
  2. +0 −3 spec/tags/19/ruby/core/numeric/i_tags.txt
@@ -3,6 +3,10 @@ def i
Complex(0, self)
end
+ def to_c
+ Complex(self, 0)
+ end
+
def imag
0
end
@@ -1,3 +0,0 @@
-fails:Numeric#i returns a Complex object
-fails:Numeric#i sets the real part to 0
-fails:Numeric#i sets the imaginary part to self

0 comments on commit 3fc33fb

Please sign in to comment.