bits

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64ToInt64

func Float64ToInt64(f float64) int64

Float64ToInt64 returns the result.

func Float64ToUint64

func Float64ToUint64(f float64) uint64

Float64ToUint64 returns the result.

func FromBytes

func FromBytes[T constraints.Number](bytes []byte) T

FromBytes returns the result.

func Int64ToFloat64

func Int64ToFloat64(f int64) float64

Int64ToFloat64 returns the result.

func Int64ToUint64

func Int64ToUint64(f int64) uint64

Int64ToUint64 returns the result.

func ToBytes

func ToBytes[T constraints.Number](t T) []byte

ToBytes converts the value.

func Uint64ToFloat64

func Uint64ToFloat64(f uint64) float64

Uint64ToFloat64 returns the result.

func Uint64ToInt64

func Uint64ToInt64(f uint64) int64

Uint64ToInt64 returns the result.

func ViewBin

func ViewBin(v any)

ViewBin performs the operation.

Types

type Num64

type Num64 uint64
const (
	BaseNaN Num64 = 0x7FF8000000000001
)

func Float64ToNum64

func Float64ToNum64(f float64) Num64

Float64ToNum64 returns the result.

func Int64ToNum64

func Int64ToNum64(f uint64) Num64

Int64ToNum64 returns the result.

func Uint64ToNum64

func Uint64ToNum64(f int64) Num64

Uint64ToNum64 returns the result.

func (Num64) At

func (b Num64) At(leftIdx int) bool

At reports whether the condition holds.

func (Num64) Float

func (b Num64) Float() float64

Float returns the result.

func (Num64) Int

func (b Num64) Int() int64

Int returns the result.

func (Num64) Num8

func (b Num64) Num8(leftIdx int) bool

Num8 reports whether the condition holds.

func (Num64) RangeInt

func (b Num64) RangeInt(leftIdx, rightIdx int) int64

RangeInt returns the result.

func (Num64) RangeUint

func (b Num64) RangeUint(leftIdx, rightIdx int) uint64

RangeUint returns the result.

func (Num64) SetAt

func (b Num64) SetAt(leftIdx int, v bool) Num64

SetAt updates or inserts a value.

func (Num64) SetRange

func (b Num64) SetRange(l, r int, v bool) Num64

SetRange updates or inserts a value.

func (Num64) Uint

func (b Num64) Uint() uint64

Uint returns the result.

type Uint8

type Uint8 uint8

func (Uint8) SetAt

func (b Uint8) SetAt(leftIdx int, v bool) Num64

SetAt updates or inserts a value.

Jump to

Keyboard shortcuts

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