compare

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToFloat64

func ToFloat64(v any) (float64, bool)

ToFloat64 converts various numeric types to float64. Returns the float64 value and true if successful, 0 and false otherwise.

func Values

func Values(a, b any) int

Values compares two values and returns:

  • -1 if a < b
  • 0 if a == b
  • 1 if a > b

Handles strings, numbers (int, int64, float64, etc.), and booleans. For incompatible types, compares by type name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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