README: math/big

This commit is contained in:
xushiwei
2024-08-01 08:46:37 +08:00
parent 45cd9e65d3
commit 69f8d1b717
2 changed files with 5 additions and 1 deletions

View File

@@ -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)

View File

@@ -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
}