Documentation ¶
Overview ¶
Package arith provides performance-sensitive arithmetic operations.
Index ¶
- Constants
- func Abs(x int64) uint64
- func Add(z, x *big.Int, y uint64) *big.Int
- func BigLength(x *big.Int) int
- func BigPow10(n uint64) *big.Int
- func Cmp(x, y uint64) int
- func CmpBits(x, y []big.Word) (r int)
- func CmpShift(x, y, shift uint64) int
- func Length(x uint64) int
- func Mul(z, x *big.Int, y uint64) *big.Int
- func MulBigPow10(z, x *big.Int, n uint64) *big.Int
- func MulPow10(x uint64, n uint64) (uint64, bool)
- func Pow10(e uint64) (uint64, bool)
- func Pow10Int(e uint64) (int64, bool)
- func PowOfTen(x uint64) bool
- func PowOfTenBig(x *big.Int) bool
- func Safe(e uint64) bool
- func Set(z *big.Int, z1, z0 uint64) *big.Int
- func Sub(z, x *big.Int, y uint64) *big.Int
- func Words(x uint64) []big.Word
Constants ¶
View Source
const ( // PowTabLen is the largest cached power for integers. PowTabLen = 20 // BigPowTabLen is the largest cached power for *big.Ints. BigPowTabLen = 1e5 )
View Source
const (
MaxInt = 1<<(intSize-1) - 1
)
View Source
const MaxLength = 20
Variables ¶
This section is empty.
Functions ¶
func MulBigPow10 ¶
MulBigPow10 sets z to x * 10**n and returns z.
func MulPow10 ¶
MulPow10 computes x * 10**n and a bool indicating whether the multiplcation was successful.
func Pow10Int ¶
Pow10Int returns 10**e and a boolean indicating whether the result fits into an int64.
func PowOfTenBig ¶
PowOfTenBig reports whether x is a power of 10.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.