ruby/lib/complex.rb

11 строки
190 B
Ruby

require 'cmath'
Object.instance_eval{remove_const :Math}
Math = CMath
def Complex.generic? (other)
other.kind_of?(Integer) ||
other.kind_of?(Float) ||
other.kind_of?(Rational)
end