(f, g)
Computes quotient of fractions ``f`` and ``g``.
Computes quotient of fractions ``f`` and ``g``.
Computes quotient of fractions f and g .
def __truediv__(f, g):
        """Computes quotient of fractions ``f`` and ``g``. """
        field = f.field

        if not g:
            raise ZeroDivisionError
        elif isinstance(g, field.dtype):
            return f.new(f.numer*g.denom, f.denom*g.numer)
        elif isinstance(g, field.ring.dtype):
            return f.new(f.numer, f.denom*g)
        else:
            if isinstance(g, FracElement):
                if isinstance(field.domain, FractionField) and field.domain.field == g.field:
                    pass
                elif isinstance(g.field.domain, FractionField) and g.field.domain.field == field:
                    return g.__rtruediv__(f)
                else:
                    return NotImplemented
            elif isinstance(g, PolyElement):
                if isinstance(field.domain, PolynomialRing) and field.domain.ring == g.ring:
                    pass
                else:
                    return g.__rtruediv__(f)

        op, g_numer, g_denom = f._extract_ground(g)

        if op == 1:
            return f.new(f.numer, f.denom*g_numer)
        elif not op:
            return NotImplemented
        else:
            return f.new(f.numer*g_denom, f.denom*g_numer)
def __truediv__ ( f , g ) : field = f . field if not g : raise ZeroDivisionError elif isinstance ( g , field . dtype ) : return f . new ( f . numer * g . denom , f . denom * g . numer ) elif isinstance ( g , field . ring . dtype ) : return f . new ( f . numer , f . denom * g ) else : if isinstance ( g , FracElement ) : if isinstance ( field . domain , FractionField ) and field . domain . field == g . field : pass elif isinstance ( g . field . domain , FractionField ) and g . field . domain . field == field : return g . __rtruediv__ ( f ) else : return NotImplemented elif isinstance ( g , PolyElement ) : if isinstance ( field . domain , PolynomialRing ) and field . domain . ring == g . ring : pass else : return g . __rtruediv__ ( f ) op , g_numer , g_denom = f . _extract_ground ( g ) if op == 1 : return f . new ( f . numer , f . denom * g_numer ) elif not op : return NotImplemented else : return f . new ( f . numer * g_denom , f . denom * g_numer )