math

package
v1.2.77 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Epsilon = 1e-6

Epsilon very small

View Source
var EpsilonClose = 1e-14
View Source
var EpsilonVeryClose = 1e-16

Functions

func AbsInt64

func AbsInt64(x int64) int64

AbsInt64 returns the absolute value of x.

func Alike

func Alike(a, b float64) bool

Alike returns true if a,b is the same exactly (no tolerance) or both NaN

func Close

func Close(a, b float64) bool

Close returns true if |a-b| < 1e14

func SoClose

func SoClose(a, b, e float64) bool

SoClose is an alias of Tolerance

func Tolerance

func Tolerance(a, b, e float64) bool

Tolerance returns true if |a-b| < e e usually can be set with Epsilon(1e-6)

func TruncPrecision

func TruncPrecision(x float64, n int) float64

TruncPrecision returns the float value of x, with case n >= 0

the maximum n bits precision.

case n < 0

-n bits of the magnitude of x trunked

Special cases are:

Trunc(±0) = ±0
Trunc(±Inf) = ±Inf
Trunc(NaN) = NaN

func VeryClose

func VeryClose(a, b float64) bool

VeryClose returns true if |a-b| < 1e16

Types

This section is empty.

Directories

Path Synopsis
Package rand implements math/rand functions in a concurrent-safe way with a global random source, independent of math/rand's global source.
Package rand implements math/rand functions in a concurrent-safe way with a global random source, independent of math/rand's global source.

Jump to

Keyboard shortcuts

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