compare

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const EPSILON float64 = 1e-9

Variables

This section is empty.

Functions

func FloatEquals

func FloatEquals(a, b float64) bool

FloatEquals check the difference of a and b is less than epsilon

func Number

func Number(a, b interface{}) int

Number compare number values

func Object

func Object(a, b interface{}) int

Object compare scalar values. Scalar value is number, boolean, string. The not-scalar value is treated as zero value. The result will be 0 if a == b, -1 if a < b, and +1 if a > b.

Types

This section is empty.

Jump to

Keyboard shortcuts

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