Opened 3 years ago

Last modified 3 years ago

#21974 new defect

Assuming x==0, x**x raises a non-informative error from Maxima

Reported by: pelegm Owned by:
Priority: major Milestone: sage-7.5
Component: symbolics Keywords: maxima, is_zero, ecl
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage: assume(x==0)
sage: (x**x).is_zero()

raise

Traceback (most recent call last):
  File "<ipython-input-4-fd8b12b8d6ab>", line 1, in <module>
    (x**x).is_zero()
  File "sage/structure/element.pyx", line 998, in sage.structure.element.Element.is_zero (/home/peleg/sage/src/build/cythonized/sage/structure/element.c:9593)
    return not self
  File "sage/symbolic/expression.pyx", line 2638, in sage.symbolic.expression.Expression.__nonzero__ (/home/peleg/sage/src/build/cythonized/sage/symbolic/expression.cpp:18221)
    return not bool(self == self._parent.zero())
  File "sage/symbolic/expression.pyx", line 2632, in sage.symbolic.expression.Expression.__nonzero__ (/home/peleg/sage/src/build/cythonized/sage/symbolic/expression.cpp:18101)
    return test_relation_maxima(self)
  File "/home/peleg/sage/local/lib/python2.7/site-packages/sage/symbolic/relation.py", line 464, in test_relation_maxima
    s = m.parent()._eval_line('is (equal(%s,%s))'%(repr(m.lhs()),repr(m.rhs())))
  File "/home/peleg/sage/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 447, in _eval_line
    result = ((result + '\n') if result else '') + max_to_string(maxima_eval("#$%s$"%statement))
  File "sage/libs/ecl.pyx", line 796, in sage.libs.ecl.EclObject.__call__ (/home/peleg/sage/src/build/cythonized/sage/libs/ecl.c:8367)
    return ecl_wrap(ecl_safe_apply(self.obj,(<EclObject>lispargs).obj))
  File "sage/libs/ecl.pyx", line 369, in sage.libs.ecl.ecl_safe_apply (/home/peleg/sage/src/build/cythonized/sage/libs/ecl.c:5991)
    raise RuntimeError("ECL says: "+ecl_base_string_pointer_safe(s))
RuntimeError: ECL says: Error executing code in Maxima: 

We should probably follow the convention of python (and sage) according to which 0 ** 0 = 1 (if we assume that x is at least complex; assuming it here does not help).

Change History (1)

comment:1 Changed 3 years ago by pelegm

  • Keywords ecl added
Note: See TracTickets for help on using tickets.