util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInputTooLarge = errors.New("input value too large")

Functions

func Ceil

func Ceil(x uint, y uint) int

Ceil computes the ceiling of x/y for x, y being integers

func CeilPow2

func CeilPow2(value uint64) (uint64, error)

func CheckedMultiply

func CheckedMultiply(a, b uint64) (uint64, bool)

CheckedMultiply multiplies a and b and returns (truncate(a*b), no_overflow)

func IsPow2

func IsPow2(value uint64) bool

func Log2Ceil

func Log2Ceil(value uint64) int

Log2Ceil computes the integer logarithm with ceiling for 64 bit unsigned ints

func Log2Floor

func Log2Floor(value uint64) int

func Max

func Max(x int, y int) int

Max returns the minimum value of inputs x, y

func Min

func Min(x int, y int) int

Min returns the minimum value of inputs x, y

Types

This section is empty.

Jump to

Keyboard shortcuts

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