anymath

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Add = &Function{
	Float64: func(a, b float64) float64 { return a + b },
	Int64:   func(a, b int64) int64 { return a + b },
	Uint64:  func(a, b uint64) uint64 { return a + b },
}
View Source
var Max = &Function{
	Init: Init{-math.MaxFloat64, math.MinInt64, 0},
	Float64: func(a, b float64) float64 {
		if a > b {
			return a
		}
		return b
	},
	Int64: func(a, b int64) int64 {
		if a > b {
			return a
		}
		return b
	},
	Uint64: func(a, b uint64) uint64 {
		if a > b {
			return a
		}
		return b
	},
}
View Source
var Min = &Function{
	Init: Init{math.MaxFloat64, math.MaxInt64, math.MaxUint64},
	Float64: func(a, b float64) float64 {
		if a < b {
			return a
		}
		return b
	},
	Int64: func(a, b int64) int64 {
		if a < b {
			return a
		}
		return b
	},
	Uint64: func(a, b uint64) uint64 {
		if a < b {
			return a
		}
		return b
	},
}

Functions

This section is empty.

Types

type Float64

type Float64 func(float64, float64) float64

type Function

type Function struct {
	Init
	Float64
	Int64
	Uint64
}

type Init

type Init struct {
	Float64 float64
	Int64   int64
	Uint64  uint64
}

type Int64

type Int64 func(int64, int64) int64

type Uint64

type Uint64 func(uint64, uint64) uint64

Jump to

Keyboard shortcuts

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