compare

package
v0.0.13-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Compare ordered values

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eq

func Eq[C Comparable[C]](a0, a1 C) bool

Convenience function for testing equality

func Max

func Max[C Comparable[C]](this, that C) C

Returns greatest element

func Min

func Min[C Comparable[C]](this, that C) C

Returns least element

Types

type Comparable

type Comparable[C any] interface {
	// Returns -1 if operand greater; 0 if operand equal; 1 if operand less
	Compare(operand C) int
}

Generic comparison interface

Jump to

Keyboard shortcuts

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