bigints

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 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 ContainsSorted added in v0.3.0

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

ContainsSorted reports whether n is in xs, which is assumed to be sorted.

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 MergeUnique

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

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

func Sort

func Sort(xs []*big.Int)

Sort in ascending 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