Skip to content
Snippets Groups Projects
Commit 9a98322f authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Fix to issue #1052: algebraic equivalence with inf.

parent 900434f1
Branches
No related tags found
No related merge requests found
......@@ -991,6 +991,8 @@ numerical_not_alg_equiv(p1, p2):= block([pvars, pval, lv, sz, pnum, stack_mtell_
if is(pval = []) then (print("STACK: ignore previous error. (2)"), return(false)),
/* User functions without a function rule cannot be evaluated numerically */
if recurse_userfunctionp(first(pval)) then return(false),
/* If we have no variables, and not a number, then bail here. */
if is(emptyp(lv)) and not(numberp(first(pval))) then return(false),
pval:errcatch(ev(is(abs(first(pval)) > 1/10000), simp)),
if is(pval = []) then (print("STACK: ignore previous error. (3)"), return(false)),
if first(pval) then return(true),
......
......@@ -104,6 +104,7 @@ class stack_answertest_test_data {
array('AlgEquiv', '', 'inf', '-inf', 0, '', ''),
array('AlgEquiv', '', '2*inf', 'inf', 0, '', ''),
array('AlgEquiv', '', '0*inf', '0', 1, '', ''),
array('AlgEquiv', '', 'exp(-%i)', 'inf', 0, '', ''),
array('AlgEquiv', '', 'x^(1/2)', 'sqrt(x)', 1, '', 'Powers and roots'),
array('AlgEquiv', '', 'x', 'sqrt(x^2)', 0, '', ''),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment