Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion symengine/lib/symengine_wrapper.in.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4944,7 +4944,7 @@ def powermod_list(a, b, m):
def has_symbol(obj, symbol=None):
cdef Basic b = _sympify(obj)
cdef Basic s = _sympify(symbol)
require(s, (Symbol, FunctionSymbol))
require(s, (Symbol, FunctionSymbol, Infinity, NegativeInfinity, NaN))
if (not symbol):
return not b.free_symbols.empty()
else:
Expand Down
8 changes: 8 additions & 0 deletions symengine/tests/test_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ def test_as_powers_dict():
assert (x*(1/Integer(2))**y).as_powers_dict() == {x: Integer(1), Integer(2): -y}
assert (2**y).as_powers_dict() == {2: y}
assert (2**-y).as_powers_dict() == {2: -y}


def test_has():
x = Symbol('x')
assert (x + oo).has(oo)
assert (x - oo).has(-oo)
assert not (x + oo).has(-oo)
#assert not (x - oo).has(oo) <-- not sure we want to test explicitly for "x + NegativeInfinity"
2 changes: 1 addition & 1 deletion symengine_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c9510fb4b5c30b84adb993573a51f2a9a38a4cfe
2c1d19740d84d73aed82db88af6de16eef535ca8
Loading