Skip to content

Commit

Permalink
Update src/algorithms/GenericFunctions.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Max Horn <[email protected]>
  • Loading branch information
nsajko and fingolfin authored Oct 18, 2024
1 parent c676b63 commit 186416a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/algorithms/GenericFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function powermod(a::T, n::Integer, m::T) where T <: RingElem
parent(a) == parent(m) || error("Incompatible parents")
if n > 1
return internal_powermod(a, n, m)
elseif n == 1
elseif isone(n)
return mod(a, m)
elseif iszero(n)
return mod(one(parent(a)), m)
Expand Down

0 comments on commit 186416a

Please sign in to comment.