Skip to content

Commit 7d2f889

Browse files
committed
Companion commit to symengine/symengine#2105
1 parent 4052cf6 commit 7d2f889

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

symengine/lib/symengine_wrapper.in.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4944,7 +4944,7 @@ def powermod_list(a, b, m):
49444944
def has_symbol(obj, symbol=None):
49454945
cdef Basic b = _sympify(obj)
49464946
cdef Basic s = _sympify(symbol)
4947-
require(s, (Symbol, FunctionSymbol))
4947+
require(s, (Symbol, FunctionSymbol, Infinity, NegativeInfinity, NaN))
49484948
if (not symbol):
49494949
return not b.free_symbols.empty()
49504950
else:

symengine/tests/test_expr.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ def test_as_powers_dict():
2626
assert (x*(1/Integer(2))**y).as_powers_dict() == {x: Integer(1), Integer(2): -y}
2727
assert (2**y).as_powers_dict() == {2: y}
2828
assert (2**-y).as_powers_dict() == {2: -y}
29+
30+
31+
def test_has():
32+
x = Symbol('x')
33+
assert (x + oo).has(oo)
34+
assert (x - oo).has(-oo)
35+
assert not (x + oo).has(-oo)
36+
#assert not (x - oo).has(oo) <-- not sure we want to test explicitly for "x + NegativeInfinity"

symengine_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
153b7e98f310bccaae586dab6b49284ccd5f4174
1+
8759c8e5ca76306c663f3372702136fc622a14a8

0 commit comments

Comments
 (0)