bigints

package
v0.0.0-...-3948e75 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package bigints provides helpers for slices of multi-precision integers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(xs []*big.Int) []*big.Int

Clone a list of integers.

func Contains

func Contains(n *big.Int, xs []*big.Int) bool

Contains reports whether n is in xs.

func Index

func Index(n *big.Int, xs []*big.Int) int

Index returns the index of the first occurrence of n in xs, or -1 if it does not appear.

func InsertSortedUnique

func InsertSortedUnique(xs []*big.Int, x *big.Int) []*big.Int

InsertSortedUnique inserts an integer into a slice of sorted distinct integers.

func Int64s

func Int64s(xs ...int64) []*big.Int

Int64s converts a list of int64s into a slice of big integers.

func IsSorted

func IsSorted(xs []*big.Int) bool

IsSorted reports whether xs is sorted in ascending order.

func Max

func Max(xs []*big.Int) *big.Int

Max returns the maximum element of xs.

func MergeUnique

func MergeUnique(xs, ys []*big.Int) []*big.Int

MergeUnique merges two slices of sorted distinct integers. Elements in both slices are deduplicated.

func Reverse

func Reverse(xs []*big.Int)

Reverse the slice in place.

func Sort

func Sort(xs []*big.Int)

Sort in ascending order.

func SortDescending

func SortDescending(xs []*big.Int)

SortDescending in descending order.

func Unique

func Unique(xs []*big.Int) []*big.Int

Unique removes consecutive duplicates.

Types

This section is empty.

Jump to

Keyboard shortcuts

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