mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-26 02:20:30 +01:00
add literal_pow(^, s::GSymbol, ::Val{-1}) = inv(s)
This commit is contained in:
parent
6e14d30903
commit
31a0620da3
@ -9,6 +9,7 @@ Base.length(s::GSymbol) = first(size(s))
|
|||||||
Base.eltype(s::GS) where GS<:GSymbol = GS
|
Base.eltype(s::GS) where GS<:GSymbol = GS
|
||||||
|
|
||||||
Base.isone(s::GSymbol) = iszero(s.pow)
|
Base.isone(s::GSymbol) = iszero(s.pow)
|
||||||
|
Base.literal_pow(::typeof(^), s::Groups.GSymbol, ::Val{-1}) = inv(s)
|
||||||
Base.inv(s::GSymbol) = change_pow(s, -s.pow)
|
Base.inv(s::GSymbol) = change_pow(s, -s.pow)
|
||||||
Base.hash(s::S, h::UInt) where S<:GSymbol = hash(s.id, hash(s.pow, hash(S, h)))
|
Base.hash(s::S, h::UInt) where S<:GSymbol = hash(s.id, hash(s.pow, hash(S, h)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user