From 69f8d1b7176dceb7f8e20d87a1b57b10a48abfd3 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Thu, 1 Aug 2024 08:46:37 +0800 Subject: [PATCH] README: math/big --- README.md | 1 + internal/lib/math/big/int.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 878879a3..0c990e7a 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,7 @@ Here are the Go packages that can be imported correctly: * [unicode/utf8](https://pkg.go.dev/unicode/utf8) * [unicode/utf16](https://pkg.go.dev/unicode/utf16) * [math](https://pkg.go.dev/math) +* [math/big](https://pkg.go.dev/math/big) (partially) * [math/bits](https://pkg.go.dev/math/bits) * [math/cmplx](https://pkg.go.dev/math/cmplx) * [math/rand](https://pkg.go.dev/math/rand) diff --git a/internal/lib/math/big/int.go b/internal/lib/math/big/int.go index e970a174..f568938b 100644 --- a/internal/lib/math/big/int.go +++ b/internal/lib/math/big/int.go @@ -62,13 +62,16 @@ func (z *Int) SetInt64(x int64) *Int { a.SetNegative(1) } else { a.SetWord(openssl.BN_ULONG(x)) + a.SetNegative(0) } return z } // SetUint64 sets z to x and returns z. func (z *Int) SetUint64(x uint64) *Int { - (*openssl.BIGNUM)(z).SetWord(openssl.BN_ULONG(x)) + a := (*openssl.BIGNUM)(z) + a.SetWord(openssl.BN_ULONG(x)) + a.SetNegative(0) return z }