def as_unary_minus()

in src/latex2sympy2_extended/latex2sympy2.py [0:0]


    def as_unary_minus(self, expr):
        if hasattr(expr, 'is_Rational') and expr.is_Rational:
            return sympy.Rational(-expr.p, expr.q)
        elif hasattr(expr, 'is_Integer') and expr.is_Integer:
            return -expr
        return sympy.Mul(-1, expr, evaluate=False)