Back to godoc.org

Package xmath

v0.0.0-...-3cf7f3f
Latest Go to latest

The latest major version is .

Published: May 27, 2020 | License: GPL3 | Module: lab.nexedi.com/kirr/go123

Overview

Package xmath provides addons to std math package.

Index

func CeilLog2

func CeilLog2(x uint64) int

CeilLog2 returns minimal i: 2^i >= x.

func CeilPow2

func CeilPow2(x uint64) uint64

CeilPow2 returns minimal y >= x, such that y = 2^i.

func FloorLog2

func FloorLog2(x uint64) int

FloorLog2 returns maximal i: 2^i <= x.

x=0 gives -> -1.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier