Skip to content

Commit 7f9b102

Browse files
author
Release Manager
committed
gh-40048: Fix primes_of_bounded_norm for noninteger entries For noninteger entries, primes_of_bouned_norm used the ceil function to convert it to an integer. This caused the function to sometimes return primes of norm bigger than the bound. Using the floor function instead, fixes the issue. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. URL: #40048 Reported by: Eloi Torrents Reviewer(s):
2 parents bbf4ff7 + 51e21e7 commit 7f9b102

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sage/rings/number_field/number_field.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3934,6 +3934,8 @@ def primes_of_bounded_norm(self, B):
39343934
Fractional ideal (3)]
39353935
sage: K.primes_of_bounded_norm(1)
39363936
[]
3937+
sage: K.primes_of_bounded_norm(1.1)
3938+
[]
39373939
sage: x = polygen(QQ, 'x')
39383940
sage: K.<a> = NumberField(x^3 - 2)
39393941
sage: P = K.primes_of_bounded_norm(30)
@@ -3953,7 +3955,7 @@ def primes_of_bounded_norm(self, B):
39533955
B = ZZ(B)
39543956
except (TypeError, AttributeError):
39553957
try:
3956-
B = ZZ(B.ceil())
3958+
B = ZZ(B.floor())
39573959
except (TypeError, AttributeError):
39583960
raise TypeError("%s is not valid bound on prime ideals" % B)
39593961
if B < 2:

0 commit comments

Comments
 (0)