Skip to content

Commit

Permalink
docs(math): update math docs (#19615)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2d3c authored Mar 1, 2024
1 parent 1c9361c commit febb7b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions math/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (i Int) Mul(i2 Int) (res Int) {
return x
}

// MulRaw multipies Int and int64
// MulRaw multiplies Int and int64
func (i Int) MulRaw(i2 int64) Int {
return i.Mul(NewInt(i2))
}
Expand Down Expand Up @@ -414,7 +414,7 @@ func MaxInt(i, i2 Int) Int {
return Int{max(i.BigInt(), i2.BigInt())}
}

// Human readable string
// String returns human-readable string
func (i Int) String() string {
return i.i.String()
}
Expand Down
16 changes: 8 additions & 8 deletions math/uint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -139,16 +139,16 @@ 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 returns 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 returns the maximum of the Uints
func MaxUint(u1, u2 Uint) Uint { return NewUintFromBigInt(max(u1.i, u2.i)) }

// Human readable string
// String returns human-readable string
func (u Uint) String() string { return u.i.String() }

// MarshalJSON defines custom encoding scheme
Expand Down Expand Up @@ -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) }

Expand Down

0 comments on commit febb7b7

Please sign in to comment.