Skip to content

Commit 69aaa2c

Browse files
committed
add unary minus on BigInt
1 parent 36fe64e commit 69aaa2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bigint.jl

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

32+
function operate_to!(output::BigInt, ::typeof(-), a::BigInt)
33+
return Base.GMP.MPZ.neg!(output, a)
34+
end
35+
3236
# *
3337
promote_operation(::typeof(*), ::Vararg{Type{BigInt},N}) where {N} = BigInt
3438
function operate_to!(output::BigInt, ::typeof(*), a::BigInt, b::BigInt)

0 commit comments

Comments
 (0)