mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
complex.rb: implement Numeric#to_c
This commit is contained in:
@@ -74,3 +74,9 @@ class Complex < Numeric
|
||||
end
|
||||
undef i
|
||||
end
|
||||
|
||||
class Numeric
|
||||
def to_c
|
||||
Complex(self, 0)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user