mathutil

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 2 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comb

func Comb(m, n int) int64

C(m, n)

func CombSet

func CombSet(m, n int) [][]int

CombSet C(m, n)

func MultiCombSet

func MultiCombSet(nums []int, n int) [][]int

Types

type Comparable

type Comparable interface {
	Less(Comparable) bool
	Sub(Comparable) Comparable
}

type Int64

type Int64 int64

func (Int64) Less

func (v Int64) Less(other Comparable) bool

func (Int64) Sub

func (v Int64) Sub(other Comparable) Comparable

type Percent

type Percent struct {
	// contains filtered or unexported fields
}

func NewPercent

func NewPercent(x, y int64) Percent

func (Percent) Less

func (p Percent) Less(other Comparable) bool

func (Percent) MarshalJSON

func (p Percent) MarshalJSON() ([]byte, error)

func (Percent) Normalize

func (p Percent) Normalize() int64

func (Percent) NormalizeWithBase

func (p Percent) NormalizeWithBase(base int64) int64

func (Percent) String

func (p Percent) String() string

func (Percent) Sub

func (p Percent) Sub(other Comparable) Comparable

func (*Percent) UnmarshalJSON

func (p *Percent) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL