Skip to content

Commit 1c9f375

Browse files
committed
add unary minus on BigInt
1 parent 5b9dfd2 commit 1c9f375

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/implementations/BigInt.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ function operate_to!(output::BigInt, ::typeof(-), a::BigInt, b::BigInt)
4141
return Base.GMP.MPZ.sub!(output, a, b)
4242
end
4343

44+
function operate_to!(output::BigInt, ::typeof(-), a::BigInt)
45+
return Base.GMP.MPZ.neg!(output, a)
46+
end
47+
4448
# *
4549

4650
promote_operation(::typeof(*), ::Vararg{Type{BigInt},N}) where {N} = BigInt

0 commit comments

Comments
 (0)