From cd0f745d4151898d13497756cddae335a37d0a31 Mon Sep 17 00:00:00 2001 From: 0x2d3c Date: Thu, 29 Feb 2024 22:10:57 +0800 Subject: [PATCH] docs(math): update math docs --- math/int.go | 4 ++-- math/uint.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/math/int.go b/math/int.go index 7c5fb2e99cdb..1900b0fed882 100644 --- a/math/int.go +++ b/math/int.go @@ -332,7 +332,7 @@ func (i Int) Mul(i2 Int) (res Int) { return x } -// MulRaw multipies Int and int64 +// MulRaw multiples Int and int64 func (i Int) MulRaw(i2 int64) Int { return i.Mul(NewInt(i2)) } @@ -413,7 +413,7 @@ func MaxInt(i, i2 Int) Int { return Int{max(i.BigInt(), i2.BigInt())} } -// Human readable string +// String Human readable string func (i Int) String() string { return i.i.String() } diff --git a/math/uint.go b/math/uint.go index 6361694743b3..a7bad2d57c8d 100644 --- a/math/uint.go +++ b/math/uint.go @@ -21,7 +21,7 @@ func (u Uint) BigInt() *big.Int { return new(big.Int).Set(u.i) } -// BigInt converts Uint to big.Int, mutative the input +// BigIntMut converts Uint to big.Int, mutative the input func (u Uint) BigIntMut() *big.Int { if u.IsNil() { return nil @@ -99,7 +99,7 @@ func (u Uint) LTE(u2 Uint) bool { return !u.GT(u2) } // Add adds Uint from another func (u Uint) Add(u2 Uint) Uint { return NewUintFromBigInt(new(big.Int).Add(u.i, u2.i)) } -// Add convert uint64 and add it to Uint +// AddUint64 convert uint64 and add it to Uint func (u Uint) AddUint64(u2 uint64) Uint { return u.Add(NewUint(u2)) } // Sub adds Uint from another @@ -113,7 +113,7 @@ func (u Uint) Mul(u2 Uint) (res Uint) { return NewUintFromBigInt(new(big.Int).Mul(u.i, u2.i)) } -// Mul multiplies two Uints +// MulUint64 multiplies two Uints func (u Uint) MulUint64(u2 uint64) (res Uint) { return u.Mul(NewUint(u2)) } // Quo divides Uint with Uint @@ -139,13 +139,13 @@ func (u Uint) Decr() Uint { return u.Sub(OneUint()) } -// Quo divides Uint with uint64 +// QuoUint64 divides Uint with uint64 func (u Uint) QuoUint64(u2 uint64) Uint { return u.Quo(NewUint(u2)) } -// Return the minimum of the Uints +// MinUint Return the minimum of the Uints func MinUint(u1, u2 Uint) Uint { return NewUintFromBigInt(min(u1.i, u2.i)) } -// Return the maximum of the Uints +// MaxUint Return the maximum of the Uints func MaxUint(u1, u2 Uint) Uint { return NewUintFromBigInt(max(u1.i, u2.i)) } // Human readable string @@ -219,7 +219,7 @@ func (u *Uint) Size() int { return len(bz) } -// Override Amino binary serialization by proxying to protobuf. +// MarshalAmino Override Amino binary serialization by proxying to protobuf. func (u Uint) MarshalAmino() ([]byte, error) { return u.Marshal() } func (u *Uint) UnmarshalAmino(bz []byte) error { return u.Unmarshal(bz) }