The Ratio equivalent of self

Property definitions

gmp :: gmp $ Numeric :: to_r
    # The Ratio equivalent of `self`
    fun to_r: Ratio do return self.to_f.to_r
lib/gmp/gmp.nit:25,5--26,44

gmp $ Ratio :: to_r
    redef fun to_r do return self
lib/gmp/gmp.nit:396,5--33

gmp :: gmp $ Float :: to_r
    redef fun to_r do
        var tmp = new NativeMPQ
        tmp.set_d self
        return new Ratio(tmp)
    end
lib/gmp/gmp.nit:99,5--103,7

gmp $ BigInt :: to_r
    #     assert(123.to_bi.to_r == 123.to_r)
    redef fun to_r do
        var tmp = new NativeMPQ
        tmp.set_z val
        return new Ratio(tmp)
    end
lib/gmp/gmp.nit:276,5--281,7

gmp :: gmp $ Int :: to_r
    redef fun to_r do
        var tmp = new NativeMPQ
        tmp.set_si(self, 1)
        return new Ratio(tmp)
    end
lib/gmp/gmp.nit:113,5--117,7