bits

package
v0.0.0-...-8cba18c Latest Latest
Warning

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

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

README

go-common/bits

This repository contains the go-common/bits library.

To install:

go get github.com/ugorji/go-common/bits

Package Documentation

Package bits enables dealing with bit sets.

Exported Package API

func FloatToHalfFloatBits(i uint32) (h uint16)
func HalfFloatToFloatBits(h uint16) (f uint32)
func PruneLeading(v []byte, pruneVal byte) (n int)
func PruneSignExt(v []byte, pos bool) (n int)
type Set []byte
type Set128 [8 * 2]byte
type Set256 [8 * 4]byte
type Set64 [8 * 1]byte

Documentation

Overview

Package bits enables dealing with bit sets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatToHalfFloatBits

func FloatToHalfFloatBits(i uint32) (h uint16)

func HalfFloatToFloatBits

func HalfFloatToFloatBits(h uint16) (f uint32)

func PruneLeading

func PruneLeading(v []byte, pruneVal byte) (n int)

func PruneSignExt

func PruneSignExt(v []byte, pos bool) (n int)

Types

type Set

type Set []byte

Set manages an arbitrary set of bits.

func (*Set) Clear

func (b *Set) Clear(i int)

func (*Set) Is

func (b *Set) Is(i int) bool

func (*Set) Set

func (b *Set) Set(i int)

type Set128

type Set128 [8 * 2]byte

Set128 manages a set of 128 bits.

A panic occurs if you try to Set, Clear or Check outside range 0-127.

func (*Set128) Clear

func (x *Set128) Clear(pos byte)

func (*Set128) Is

func (x *Set128) Is(pos byte) bool

func (*Set128) Set

func (x *Set128) Set(pos byte)

type Set256

type Set256 [8 * 4]byte

Set256 manages a set of 256 bits.

func (*Set256) Clear

func (x *Set256) Clear(pos byte)

func (*Set256) Is

func (x *Set256) Is(pos byte) bool

func (*Set256) Set

func (x *Set256) Set(pos byte)

type Set64

type Set64 [8 * 1]byte

Set64 manages a set of 64 bits.

A panic occurs if you try to Set, Clear or Check outside range 0-63.

func (*Set64) Clear

func (x *Set64) Clear(pos byte)

func (*Set64) Is

func (x *Set64) Is(pos byte) bool

func (*Set64) Set

func (x *Set64) Set(pos byte)

Jump to

Keyboard shortcuts

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