math

package
v2.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeilToPowerOfTwo

func CeilToPowerOfTwo(n int) int

CeilToPowerOfTwo returns n if it is a power-of-two, otherwise the next-highest power-of-two.

func ClosestPowerOfTwo

func ClosestPowerOfTwo(n int) int

ClosestPowerOfTwo returns n if it is a power-of-two, otherwise the closest power-of-two.

func FloorToPowerOfTwo

func FloorToPowerOfTwo(n int) int

FloorToPowerOfTwo returns n if it is a power-of-two, otherwise the next-highest power-of-two.

func IsPowerOfTwo

func IsPowerOfTwo(n int) bool

IsPowerOfTwo reports whether given integer is a power of two.

Types

This section is empty.

Jump to

Keyboard shortcuts

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