Skip to content

Commit

Permalink
Fix is_rational (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Jul 8, 2023
1 parent 6d5e988 commit c7ab8cd
Show file tree
Hide file tree
Showing 3 changed files with 9 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 = "Hecke"
uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
version = "0.19.4"
version = "0.19.5"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down
2 changes: 1 addition & 1 deletion src/NumField/NfRel/NfRel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ function is_rational(a::NfRelElem)
return false
end
end
return true
return is_rational(coeff(a, 0))
end

################################################################################
Expand Down
7 changes: 7 additions & 0 deletions test/NfRel/NfRel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,12 @@
@test is_rational(2*b^0)
@test is_rational(2*o^0)
@test !is_rational(o)

Qx, x = QQ["x"]
K, r = number_field(x^3 - 3x^2 - 4x + 8, "r")
Ky, y = K["y"]
L, = number_field(y^2 - (2-r^2)//2, "q")
@test !(@inferred is_rational(L(r)))
@test_throws ErrorException QQ(L(r))
end
end

2 comments on commit c7ab8cd

@thofma
Copy link
Owner Author

@thofma thofma commented on c7ab8cd Jul 8, 2023

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/87111

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.19.5 -m "<description of version>" c7ab8cd067cbddc815002a1dcde0da3e1a21a64c
git push origin v0.19.5

Please sign in to comment.