unit

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(name string, num *big.Rat, unit Units)

func Convert

func Convert(n *big.Rat, from, to Units) (*big.Rat, error)

func Defaults

func Defaults() map[string]unitDef

func Normalize

func Normalize(n *big.Rat, x Units) *big.Rat

Types

type ConformanceError

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

func (ConformanceError) Error

func (c ConformanceError) Error() string

type Units

type Units []unitEntry

func Get

func Get(name string) (unit Units, ok bool)

func Must

func Must(x string) Units

func (Units) Conforms

func (u1 Units) Conforms(u2 Units) bool

func (Units) Dimension

func (u Units) Dimension() dimension.Dimension

func (Units) Exp

func (u1 Units) Exp(x int) Units

func (Units) IsSingle

func (u1 Units) IsSingle() bool

func (Units) Mul

func (this Units) Mul(other Units) Units

func (Units) Quo

func (this Units) Quo(other Units) Units

func (Units) Simplify

func (units Units) Simplify() Units

func (Units) String

func (u Units) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳