Skip to content

Commit 36fe64e

Browse files
committed
add copy to operate_to! on BigInts
1 parent 8e0eda0 commit 36fe64e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bigint.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ promote_operation(::typeof(+), ::Vararg{Type{BigInt},N}) where {N} = BigInt
1616
function operate_to!(output::BigInt, ::typeof(+), a::BigInt, b::BigInt)
1717
return Base.GMP.MPZ.add!(output, a, b)
1818
end
19-
#function operate_to!(output::BigInt, op::typeof(+), a::BigInt, b::LinearAlgebra.UniformScaling)
20-
# return operate_to!(output, op, a, b.λ)
21-
#end
19+
function operate_to!(output::BigInt, ::typeof(copy), a::BigInt)
20+
return Base.GMP.MPZ.set!(output, a)
21+
end
22+
function operate_to!(output::BigInt, ::typeof(copy), a::Int)
23+
return Base.GMP.MPZ.set_si!(output, a)
24+
end
2225

2326
# -
2427
promote_operation(::typeof(-), ::Vararg{Type{BigInt},N}) where {N} = BigInt

0 commit comments

Comments
 (0)