Skip to content

Commit

Permalink
docs(math): update math docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2d3c committed Feb 29, 2024
1 parent dbc1ded commit cd0f745
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions math/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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()
}
Expand Down
14 changes: 7 additions & 7 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,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
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 cd0f745

Please sign in to comment.