Commit Graph

13 Commits

Author SHA1 Message Date
Hoa Nguyen
22aa95ccbd
chore: make fmt.Errorf use %w to wrap error instead of %v (#20350) 2024-05-12 08:11:25 +00:00
Qt
febb7b7ece
docs(math): update math docs (#19615) 2024-03-01 12:36:00 +00:00
alpharush
a383208a07
docs: documenting some panicking APIs (#19115) 2024-01-19 09:16:56 +00:00
Đông Liều
a6eea3c5ea
feat(math): add mutative api for Uint.BigInt() (#18247) 2023-11-07 08:35:17 +00:00
Đông Liều
ff3ec25873
fix(math): fix panic on Uint.BigInt() (#18228) 2023-10-24 20:29:23 +00:00
Facundo Medica
bbf2faa699
fix(math): NewUintFromBigInt argument mutation (#18214) 2023-10-23 14:12:52 +00:00
Facundo Medica
442c3c5e4b
fix: RelativePow now returns 1 when 0^0 (#18211) 2023-10-23 13:21:13 +00:00
Jacob Gadikian
8d4ff7a19a
style: bump golangci-lint (#16667) 2023-06-23 12:49:34 +00:00
Marko
1f2875d445
style: gofumpt linting (#15605) 2023-03-30 06:27:38 +00:00
Julien Robert
55373cb614
feat: add uint IsNil method (#13381) 2022-09-25 09:19:50 +00:00
Emmanuel T Odeke
b2af716bf7
math: derive marshalled byte length from copy, not blind assumptions (#12010)
The specification of "copy", the builtin function per
https://pkg.go.dev/builtin#copy, says that it returns the minimum of
len(src) and len(dst) when invoked as:

   copy(dst, src)

of which the prior code blindly assumed that everytime that
copy is invoked that the buffer provided had enough size
to accomodate the contents of *.MarshalTo but this isn't true
at all if len(data) is less than the values of .Marshal()
2022-05-23 12:08:11 +02:00
Emmanuel T Odeke
54d764b9a8
fix: math: fix Uint.Unmarshal's lack of negative value checking (#11996)
This change adds a negative value check to Uint.Unmarshal,
which coincidentally is fixed by refactoring for code reuse.
While here, added tests to ensure we don't regress.

Fixes #11995
2022-05-19 20:28:06 +00:00
Aleksandr Bezobchuk
4f04beae34
refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00