math

package
v0.0.0-...-3231407 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignDown

func AlignDown(x int64, align int64) int64

AlignDown will align down the x by align. For example: AlignDown(1, 2) = 0 AlignDown(29, 14) = 28

func Max64

func Max64(x, y int64) int64

Max64 returns the larger of x or y.

func Min

func Min(x, y int) int

Min returns the smaller of x or y.

func Min64

func Min64(x, y int64) int64

Min64 returns the smaller of x or y.

Types

type Segment

type Segment struct {
	Index  int64
	Offset int64
	Count  int
}

Segment represents a single segment.

type Segments

type Segments struct {
	// contains filtered or unexported fields
}

Segments represents a range of segments.

func NewSegments

func NewSegments(offset int64, step int, count int64, size int64) (Segments, error)

NewSegments creates a new Segments object.

func (Segments) All

func (r Segments) All() chan Segment

All provides a channel of all segments.

Jump to

Keyboard shortcuts

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