Sha256: 5f89fb7e9b401e4faf67445484ef93c4c49477f6ce35e564556813cebb5d0218

Contents?: true

Size: 147 Bytes

Versions: 23

Compression:

Stored size: 147 Bytes

Contents

class Complex
  def to_r
    raise "Can't convert #{self} into Rational" unless imag.eql?(0)
    real.to_r
  end unless method_defined?(:to_r)
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
backports-2.5.1 lib/backports/1.9.2/complex.rb
backports-2.5.0 lib/backports/1.9.2/complex.rb
backports-2.4.0 lib/backports/1.9.2/complex.rb