Skip to content

Commit

Permalink
Add dummy hash(::FractionalIdeal) (#4428)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Jan 12, 2025
1 parent a60b0d8 commit 374c805
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Rings/FractionalIdeal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ function ==(a::FractionalIdeal, b::FractionalIdeal)
return a.num*b.den == b.num*a.den
end

function Base.hash(a::FractionalIdeal, h::UInt)
b = 0x4680fb583e498597 % UInt
# there is nothing better to include in the hash
h = hash(base_ring(a), h)
return xor(b, h)
end

function ^(a::FractionalIdeal, b::Int)
return fractional_ideal(a.num^b, a.den^b)
end

0 comments on commit 374c805

Please sign in to comment.