@staticmethod
    def fromfloat(f):
        # FIXME: this is the temporary not exact implementation
        assert isinstance(f, float)
        d = 1000000
        n = int(f * d)
        from fractions import gcd
        _gcd = gcd(n, d)
        return W_Rational.fromint(n/_gcd, d/_gcd)
dataset/ETHPy150Open samth/pycket/pycket/values.py/W_Rational.fromfloat/original