numbers

package
v0.0.0-...-28dd55f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Complex

type Complex[T StdlibNumeric] struct {
	// contains filtered or unexported fields
}

func (*Complex[T]) Add

func (c *Complex[T]) Add(other *Complex[T]) *Complex[T]

func (*Complex[T]) FromNumber

func (c *Complex[T]) FromNumber(n T)

func (*Complex[T]) FromString

func (c *Complex[T]) FromString(s string)

func (*Complex[T]) Mul

func (c *Complex[T]) Mul(other *Complex[T]) *Complex[T]

func (*Complex[T]) New

func (c *Complex[T]) New() *Complex[T]

func (*Complex[T]) String

func (c *Complex[T]) String() string

func (*Complex[T]) Sub

func (c *Complex[T]) Sub(other *Complex[T]) *Complex[T]

type CustomNumeric

type CustomNumeric[N StdlibNumeric, T any] interface {
	comparable
	fmt.Stringer
	FromString(string)
	FromNumber(N)
	New() T
	Add(T) T
	Sub(T) T
	Mul(T) T
}

type Rational

type Rational[T StdlibIntegers] struct {
	// contains filtered or unexported fields
}

func (*Rational[T]) Add

func (r *Rational[T]) Add(other *Rational[T]) *Rational[T]

func (*Rational[T]) FromNumber

func (r *Rational[T]) FromNumber(n T)

func (*Rational[T]) FromString

func (r *Rational[T]) FromString(s string)

func (*Rational[T]) Mul

func (r *Rational[T]) Mul(other *Rational[T]) *Rational[T]

func (*Rational[T]) New

func (r *Rational[T]) New() *Rational[T]

func (*Rational[T]) String

func (r *Rational[T]) String() string

func (*Rational[T]) Sub

func (r *Rational[T]) Sub(other *Rational[T]) *Rational[T]

type StdlibIntegers

type StdlibIntegers interface {
	int | int8 | int16 | int32 | int64
}

type StdlibNumeric

type StdlibNumeric interface {
	int | int8 | int16 | int32 | int64 | float32 | float64
}

Jump to

Keyboard shortcuts

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