From 227e8bb44495a733a82f453b57601868c757ed96 Mon Sep 17 00:00:00 2001 From: Jeroen Demeyer Date: Tue, 19 Jan 2016 19:47:06 +0100 Subject: [PATCH 1/2] Add doctest for floor division --- src/sage/rings/polynomial/polynomial_template.pxi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/polynomial_template.pxi b/src/sage/rings/polynomial/polynomial_template.pxi index b4cbda99fb6..76aa8c4768d 100644 --- a/src/sage/rings/polynomial/polynomial_template.pxi +++ b/src/sage/rings/polynomial/polynomial_template.pxi @@ -410,13 +410,21 @@ cdef class Polynomial_template(Polynomial): cpdef RingElement _floordiv_(self, RingElement right): """ - EXAMPLE:: + EXAMPLES:: sage: P. = GF(2)[] sage: x//(x + 1) 1 sage: (x + 1)//x 1 + sage: F = GF(47) + sage: R. = F[] + sage: x // 1 + x + sage: x // F(1) + x + sage: 1 // x + 0 """ cdef Polynomial_template _right = right From bca94fce831315fc88cc96ceb709977beb8d99fe Mon Sep 17 00:00:00 2001 From: Jeroen Demeyer Date: Wed, 20 Jan 2016 22:31:38 +0100 Subject: [PATCH 2/2] Doctest also the parent of floor division --- src/sage/rings/polynomial/polynomial_template.pxi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/polynomial_template.pxi b/src/sage/rings/polynomial/polynomial_template.pxi index 76aa8c4768d..a0c9499970e 100644 --- a/src/sage/rings/polynomial/polynomial_template.pxi +++ b/src/sage/rings/polynomial/polynomial_template.pxi @@ -1,11 +1,15 @@ """ Polynomial Template for C/C++ Library Interfaces """ + #***************************************************************************** # Copyright (C) 2008 Martin Albrecht # Copyright (C) 2008 Robert Bradshaw # -# Distributed under the terms of the GNU General Public License (GPL) +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** @@ -425,6 +429,10 @@ cdef class Polynomial_template(Polynomial): x sage: 1 // x 0 + sage: parent(x // 1) + Univariate Polynomial Ring in x over Finite Field of size 47 + sage: parent(1 // x) + Univariate Polynomial Ring in x over Finite Field of size 47 """ cdef Polynomial_template _right = right