(f, check=True)
return res
Computes inverse of a fraction ``f``.
Computes inverse of a fraction ``f``.
Computes inverse of a fraction f .
def invert(f, check=True):
        """Computes inverse of a fraction ``f``. """
        if check and f.ring is not None and not f.ring.is_unit(f):
            raise NotReversible(f, f.ring)
        res = f.per(f.den, f.num, cancel=False)
        return res
def invert ( f , check = True ) : if check and f . ring is not None and not f . ring . is_unit ( f ) : raise NotReversible ( f , f . ring ) res = f . per ( f . den , f . num , cancel = False ) return res