ordered

package module
v0.0.0-...-274704c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package ordered 为有序类型提供实用函数。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp[T cmp.Ordered](n, low, high T) T

Clamp 返回一个夹在给定的最小值和最大值之间的值。

func First

func First[T cmp.Ordered](x T, y ...T) T

First 返回固定数量的 cmp.Ordered 类型参数中的第一个非默认值。

Types

This section is empty.

Jump to

Keyboard shortcuts

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