es_number

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float

type Float interface {
	Format
	Precision
	Float32() float32
	Float64() float64
}

type Format

type Format interface {
	String() string
	Pretty(l lang.Lang) string
}

type Integer

type Integer interface {
	Format
	Precision
	Int() int
	Int8() int8
	Int16() int16
	Int32() int32
	Int64() int64
}

type Number

type Number interface {
	Format
	Integer
	Float
	Compare(other Number) int
}

func Max

func Max(nums ...interface{}) Number

func Min

func Min(nums ...interface{}) Number

func New

func New(v interface{}) Number

func Sum

func Sum(nums ...interface{}) Number

func Unify

func Unify(nums ...interface{}) []Number

Convert all numbers in same precision numbers. Invalid numbers will be filtered out.

func Zero

func Zero() Number

type Precision

type Precision interface {
	IsValid() bool
	IsNaN() bool
	IsInt() bool
	IsFloat() bool
}

Jump to

Keyboard shortcuts

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