Skip to content

Commit 5b9dfd2

Browse files
committed
add copy to operate_to! on BigInts
1 parent 772c4e0 commit 5b9dfd2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/implementations/BigInt.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ promote_operation(::typeof(+), ::Vararg{Type{BigInt},N}) where {N} = BigInt
2626
function operate_to!(output::BigInt, ::typeof(+), a::BigInt, b::BigInt)
2727
return Base.GMP.MPZ.add!(output, a, b)
2828
end
29+
function operate_to!(output::BigInt, ::typeof(copy), a::BigInt)
30+
return Base.GMP.MPZ.set!(output, a)
31+
end
32+
function operate_to!(output::BigInt, ::typeof(copy), a::Int)
33+
return Base.GMP.MPZ.set_si!(output, a)
34+
end
2935

3036
# -
3137

0 commit comments

Comments
 (0)