# Ticket #10888: trac_10888_evaluation_of_multi_polynomials.patch

File trac_10888_evaluation_of_multi_polynomials.patch, 1.7 KB (added by wuthrich, 8 years ago)

only uploaded for discussion

• ## sage/rings/polynomial/multi_polynomial_libsingular.pyx

```# HG changeset patch
# User Chris Wuthrich <christian.wuthrich@gmail.com>
# Date 1299787936 0
# Node ID 73ef0c9e7f6e3e7d142c23c801b77df92a849b1b
# Parent  43717942fe51d6aaa4b0921554bc1bfff383485a
trac 10888: evaluation of multi_polynomials gives back elements in the base ring.

diff -r 43717942fe51 -r 73ef0c9e7f6e sage/rings/polynomial/multi_polynomial_libsingular.pyx```
 a sage: f(5,3,10) 4580 See #8502:: See #8502 and #10888:: sage: x = polygen(QQ) sage: K. = NumberField(x^2+47) 9 sage: a.parent() is QQ True sage: a = f(X=2,Y=3,Z=4);a 9 sage: a.parent() is QQ True """ cdef MPolynomialRing_libsingular parent = (self._parent) if len(kwds) > 0: f = self.subs(**kwds) if len(x) > 0: return f(*x) else: return f if f == 0: return parent._base._zero_element if f in parent.base_ring(): return parent.base_ring()(f) cdef int l = len(x) cdef MPolynomialRing_libsingular parent = (self._parent) cdef ring *_ring = parent._ring if l == 1 and (PY_TYPE_CHECK(x[0], tuple) or PY_TYPE_CHECK(x[0], list)):