bigint

package
v1.0.0-beta.14 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bigint implements a set of functions for big integer arithmetic.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnequallySizedSlices = errors.New("operation not defined for differently sized slices")
)

Errors for bigint package.

Functions

func AddSmall

func AddSmall(b []uint32, a uint32) int

AddSmall adds a uint32 to a big int and returns the highest index that was changed.

func FullAdd

func FullAdd(lh, rh uint32, carry bool) (uint32, bool)

FullAdd returns the sum and whether the operation overflowed.

func IsNegative

func IsNegative(b []uint32) bool

IsNegative checks whether the given big int represents a negative number in two's complement.

func MustAdd

func MustAdd(b []uint32, rh []uint32)

MustAdd adds the given big ints together.

func MustCmp

func MustCmp(lh, rh []uint32) int

MustCmp compares the given big ints with each other.

func MustSub

func MustSub(b []uint32, rh []uint32)

MustSub subtracts rh from b.

Types

This section is empty.

Jump to

Keyboard shortcuts

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