If self contains a Ratio, return the corresponding Ratio

assert("123".to_r == 123.to_r)
assert("-123".to_r == -123.to_r)
assert("1/2".to_r == 0.5.to_r)
assert("-1/2".to_r == -0.5.to_r)

Property definitions

gmp :: gmp $ Text :: to_r
    # If `self` contains a Ratio, return the corresponding Ratio
    #
    #     assert("123".to_r == 123.to_r)
    #     assert("-123".to_r == -123.to_r)
    #     assert("1/2".to_r == 0.5.to_r)
    #     assert("-1/2".to_r == -0.5.to_r)
    fun to_r: Ratio do
        assert is_r
        var tmp = new NativeMPQ
        tmp.set_str self.to_cstring
        return new Ratio(tmp)
    end
lib/gmp/gmp.nit:78,5--89,7