From 207a95469fc54818b325f521069991449437779b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 11 Feb 2023 09:19:43 +0100 Subject: [PATCH] Update src/sage/rings/polynomial/integer_valued_polynomials.py Co-authored-by: Travis Scrimshaw --- src/sage/rings/polynomial/integer_valued_polynomials.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/polynomial/integer_valued_polynomials.py b/src/sage/rings/polynomial/integer_valued_polynomials.py index 3c8ed2c6390..1e1243d010a 100644 --- a/src/sage/rings/polynomial/integer_valued_polynomials.py +++ b/src/sage/rings/polynomial/integer_valued_polynomials.py @@ -209,8 +209,8 @@ def product_on_basis(self, n1, n2): if j < i: j, i = i, j - return self.sum((-1)**k * i.binomial(k) * (i + j - k).binomial(i) * - self.basis()[i + j - k] for k in range(i + 1)) + R = self.base_ring() + return self._from_dict({i+j-k: R((-1)**k * i.binomial(k) * (i + j - k).binomial(i)) for k in range(i + 1)}) def from_polynomial(self, p): """