def test_sign(): assert sign(1.2) == 1 assert sign(-1.2) == -1 assert sign(3 * I) == I assert sign(-3 * I) == -I assert sign(0) == 0 assert sign(nan) == nan
def test_sign(): x = Symbol("x") e1 = sympy.sign(sympy.Symbol("x")) e2 = sign(x) assert sympify(e1) == e2 assert e2._sympy_() == e1