MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Ordered

Interface Ordered

constraints/constraints.go:38–40  ·  view source on GitHub ↗

Ordered is a generic type constraint for all ordered data types in Go. Loosely speaking, in mathematics a field is an ordered field if there is a "total order" (a binary relation - in this case `<` symbol) such that we will always have if a < b then a + c < b + c and if 0 < a, 0 < b then 0 < a.b The

Source from the content-addressed store, hash-verified

36// The idea in Go is quite similar, though only limited to Go standard types
37// not user defined types.
38type Ordered interface {
39 Integer | ~string | Float
40}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected