Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pelegm opened this issue Nov 26, 2016 · 1 comment
Open

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

pelegm opened this issue Nov 26, 2016 · 1 comment

Comments

@pelegm
Copy link
Contributor

pelegm commented Nov 26, 2016

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).

Component: symbolics

Keywords: maxima, is_zero, ecl

Issue created by migration from https://trac.sagemath.org/ticket/21974

@pelegm pelegm added this to the sage-7.5 milestone Nov 26, 2016
@pelegm
Copy link
Contributor Author

pelegm commented Nov 26, 2016

Changed keywords from maxima, is_zero to maxima, is_zero, ecl

@mkoeppe mkoeppe removed this from the sage-7.5 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants