diff --git a/Project.toml b/Project.toml index 23fb8a1a3f..7295f3a1ac 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/NumField/NfRel/NfRel.jl b/src/NumField/NfRel/NfRel.jl index 9579a2cf1f..33aeb42585 100644 --- a/src/NumField/NfRel/NfRel.jl +++ b/src/NumField/NfRel/NfRel.jl @@ -496,7 +496,7 @@ function is_rational(a::NfRelElem) return false end end - return true + return is_rational(coeff(a, 0)) end ################################################################################ diff --git a/test/NfRel/NfRel.jl b/test/NfRel/NfRel.jl index b19710b355..6fc905af33 100644 --- a/test/NfRel/NfRel.jl +++ b/test/NfRel/NfRel.jl @@ -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