complex.rb: implement Numeric#to_c

This commit is contained in:
fn ⌃ ⌥
2022-10-24 09:31:47 -07:00
parent 7801741790
commit c65200cb5a
+6
View File
@@ -74,3 +74,9 @@ class Complex < Numeric
end
undef i
end
class Numeric
def to_c
Complex(self, 0)
end
end