Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 9ca27e7

Browse files
author
Matthias Koeppe
committed
In doctests, replace floor(.../...) by //
1 parent dc8cc8c commit 9ca27e7

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

src/sage/categories/filtered_algebras_with_basis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def induced_graded_map(self, other, f):
325325
sage: def map_on_basis(m): # redefining map_on_basis
326326
....: d = m.dict()
327327
....: i = d.get('x', 0); j = d.get('y', 0); k = d.get('z', 0)
328-
....: g = (h[1] ** i) * (h[2] ** (floor(j/2))) * (h[3] ** (floor(k/3)))
328+
....: g = (h[1] ** i) * (h[2] ** (j // 2) * (h[3] ** (k // 3)))
329329
....: g += i * (h[1] ** (i+j+k))
330330
....: return g
331331
sage: f = A.module_morphism(on_basis=map_on_basis,

src/sage/combinat/k_regular_sequence.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
....: def u(n):
4949
....: if n <= 1:
5050
....: return n
51-
....: return 2*u(floor(n/2)) + u(ceil(n/2))
51+
....: return 2 * u(n // 2) + u((n+1) // 2)
5252
sage: tuple(u(n) for n in srange(10))
5353
(0, 1, 3, 5, 9, 11, 15, 19, 27, 29)
5454

src/sage/combinat/similarity_class_type.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1201,12 +1201,12 @@ def dictionary_from_generator(gen):
12011201
EXAMPLES::
12021202
12031203
sage: from sage.combinat.similarity_class_type import dictionary_from_generator
1204-
sage: dictionary_from_generator(((floor(x/2), x) for x in range(10)))
1204+
sage: dictionary_from_generator(((x // 2, x) for x in range(10)))
12051205
{0: 1, 1: 5, 2: 9, 3: 13, 4: 17}
12061206
12071207
It also works with lists::
12081208
1209-
sage: dictionary_from_generator([(floor(x/2),x) for x in range(10)])
1209+
sage: dictionary_from_generator([(x // 2, x) for x in range(10)])
12101210
{0: 1, 1: 5, 2: 9, 3: 13, 4: 17}
12111211
12121212
.. NOTE::

src/sage/geometry/polyhedron/base3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ def is_neighborly(self, k=None):
15021502
is neighborly::
15031503
15041504
sage: testpolys = [polytopes.cube(), polytopes.cyclic_polytope(6, 9), polytopes.simplex(6)]
1505-
sage: [(P.neighborliness()>=floor(P.dim()/2)) == P.is_neighborly() for P in testpolys]
1505+
sage: [(P.neighborliness() >= P.dim() // 2) == P.is_neighborly() for P in testpolys]
15061506
[True, True, True]
15071507
15081508
"""

src/sage/geometry/polyhedron/base_ZZ.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def minkowski_decompositions(self):
806806
sage: [ len(square.dilation(i).minkowski_decompositions())
807807
....: for i in range(6) ]
808808
[1, 2, 5, 8, 13, 18]
809-
sage: [ ceil((i^2+2*i-1)/2)+1 for i in range(10) ]
809+
sage: [ integer_ceil((i^2 + 2*i - 1) / 2) + 1 for i in range(10) ]
810810
[1, 2, 5, 8, 13, 18, 25, 32, 41, 50]
811811
"""
812812
if self.dim() > 2 or not self.is_compact():

src/sage/quadratic_forms/quadratic_form__local_representation_conditions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class QuadraticFormLocalRepresentationConditions():
4848
Reals: [0, +Infinity]
4949
p = 2: [0, 0, 0, +Infinity, 0, 0, 0, 0]
5050
sage: E = [m for m in range(100) if not Q3.is_locally_represented_number(m)]
51-
sage: E1 = [m for m in range(1,100) if m / 2**(2*floor(valuation(m,2)/2)) % 8 == 7]
51+
sage: E1 = [m for m in range(1,100) if m / 2**(2 * (valuation(m,2) // 2)) % 8 == 7]
5252
sage: E == E1
5353
True
5454
sage: E

src/sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
Sage example in ./graphtheory.tex, line 340::
8787
8888
sage: all( graphs.KneserGraph(n,k).chromatic_number() == n - 2*k + 2
89-
....: for n in range(5,9) for k in range(2,floor(n/2)) )
89+
....: for n in range(5, 9) for k in range(2, n // 2) )
9090
True
9191
9292
Sage example in ./graphtheory.tex, line 459::

src/sage/tests/books/computational-mathematics-with-sagemath/numbertheory_doctest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
....: q = lcm(range(1,n+1))
106106
....: pmax = RR(q*(log(n)+1))
107107
....: m = ZZ(2*pmax^2)
108-
....: m = ceil(m/q)*q + 1
108+
....: m = integer_ceil(m / q) * q + 1
109109
....: a = harmonic_mod(n,m)
110110
....: return rational_reconstruction(a,m)
111111

0 commit comments

Comments
 (0)