Skip to content

Commit

Permalink
feat: allow more types for jacobi_symbol (#1855)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Sep 19, 2024
1 parent 4d25cd4 commit 59d6a4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Nemo"
uuid = "2edaba10-b0f1-5616-af89-8c11ac63239a"
version = "0.47.0"
version = "0.47.1"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fmpz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,8 @@ function jacobi_symbol(x::ZZRingElem, y::ZZRingElem)
(Ref{ZZRingElem}, Ref{ZZRingElem}), x, y))
end

jacobi_symbol(x::IntegerUnion, y::IntegerUnion) = jacobi_symbol(ZZ(x), ZZ(y))

@doc raw"""
jacobi_symbol(x::Int, y::Int)
Expand Down
8 changes: 7 additions & 1 deletion test/flint/fmpz-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1221,11 +1221,17 @@ end

@test jacobi_symbol(2, 3) == -1

for T in (Int, Integer, ZZRingElem)
for S in (Int, Integer, ZZRingElem)
@test jacobi_symbol(T(2), S(3)) == -1
end
end

@test_throws DomainError jacobi_symbol(2, 0)

@test_throws DomainError jacobi_symbol(-5, 4)

for T in [Int, ZZRingElem]
for T in (Int, ZZRingElem)
for iters = 1:1000
m1 = T(rand(-100:100))
n1 = T(rand(-100:100))
Expand Down

2 comments on commit 59d6a4f

@lgoettgens
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/115485

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.47.1 -m "<description of version>" 59d6a4f8bdf515452665ab687a1baf95e0b435aa
git push origin v0.47.1

Please sign in to comment.