Skip to content

Commit

Permalink
fix: Base.GMP.MPZ.invert yielding return code instead of return value
Browse files Browse the repository at this point in the history
  • Loading branch information
NegaScout committed Dec 23, 2024
1 parent dde5028 commit e4c2c59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ end

invert!(x::BigInt, a::BigInt, b::BigInt) =
ccall((:__gmpz_invert, libgmp), Cint, (mpz_t, mpz_t, mpz_t), x, a, b)
invert(a::BigInt, b::BigInt) = invert!(BigInt(), a, b)
invert!(x::BigInt, b::BigInt) = invert!(x, x, b)
function invert(a::BigInt, b::BigInt)
ret = deepcopy(a)
invert!(ret, b)
return ret
end

for op in (:add_ui, :sub_ui, :mul_ui, :mul_2exp, :fdiv_q_2exp, :pow_ui, :bin_ui)
op! = Symbol(op, :!)
Expand Down

0 comments on commit e4c2c59

Please sign in to comment.