bits

package
v0.0.0-...-69d094b Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bits 提供位操作相关的逻辑

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear[T constraints.Unsigned](orig T, offsets ...int) T

Clear 按偏移量清除位

func HasAll

func HasAll[T constraints.Unsigned](b T, offsets ...int) bool

HasAll 返回指定的位是否全部一个置位了

func HasAny

func HasAny[T constraints.Unsigned](b T, offsets ...int) bool

HasAny 返回指定的位是否有任何一个置位了

func New64

func New64(offsetsToSet ...int) uint64

New64 初始化一个 uint64 的位掩码

func Set

func Set[T constraints.Unsigned](orig T, offsets ...int) T

Set 按偏移量设置位

Types

This section is empty.

Jump to

Keyboard shortcuts

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