epsilon

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultE = Normal(128)
)

Functions

func Within

func Within(a float64, b float64) bool

Types

type E added in v0.10.0

type E f

func Absolute added in v0.10.1

func Absolute(e float64) E

func New added in v0.10.0

func New(epsilon f) *E

func Normal added in v0.10.1

func Normal(i float64) E

Normal calculates if two float64 values are very close to one another. This is based on the principle that if a ~ b, (a - b) / (a + b) ~ 0.

See https://stackoverflow.com/a/32334103/873865.

func Relative added in v0.10.1

func Relative(t float64) E

func (E) Within added in v0.10.0

func (e E) Within(a float64, b float64) bool

Jump to

Keyboard shortcuts

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