huge

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IntNegativeOne = NewInt(-1)    // 默认初始化的-1值Int,应当将其当作常量使用
	IntZero        = NewInt(0)     // 默认初始化的0值Int,应当将其当作常量使用
	IntOne         = NewInt(1)     // 默认初始化的1值Int,应当将其当作常量使用
	IntTen         = NewInt(10)    // 默认初始化的10值Int,应当将其当作常量使用
	IntHundred     = NewInt(100)   // 默认初始化的100值Int,应当将其当作常量使用
	IntThousand    = NewInt(1000)  // 默认初始化的1000值Int,应当将其当作常量使用
	IntTenThousand = NewInt(10000) // 默认初始化的10000值Int,应当将其当作常量使用
)

Functions

This section is empty.

Types

type Int

type Int big.Int

func NewInt

func NewInt[T generic.Number](x T) *Int

NewInt 创建一个 Int

func NewIntByString added in v0.3.4

func NewIntByString(i string) *Int

NewIntByString 通过字符串创建一个 Int

  • 如果字符串不是一个合法的数字,则返回 0

func (*Int) Abs added in v0.3.4

func (slf *Int) Abs() *Int

Abs 返回数字的绝对值

func (*Int) Add

func (slf *Int) Add(i *Int) *Int

func (*Int) AddInt

func (slf *Int) AddInt(i int) *Int

func (*Int) AddInt16

func (slf *Int) AddInt16(i int16) *Int

func (*Int) AddInt32

func (slf *Int) AddInt32(i int32) *Int

func (*Int) AddInt64

func (slf *Int) AddInt64(i int64) *Int

func (*Int) AddInt8

func (slf *Int) AddInt8(i int8) *Int

func (*Int) AddUint

func (slf *Int) AddUint(i uint) *Int

func (*Int) AddUint16

func (slf *Int) AddUint16(i uint16) *Int

func (*Int) AddUint32

func (slf *Int) AddUint32(i uint32) *Int

func (*Int) AddUint64

func (slf *Int) AddUint64(i uint64) *Int

func (*Int) AddUint8

func (slf *Int) AddUint8(i uint8) *Int

func (*Int) And added in v0.3.4

func (slf *Int) And(i *Int) *Int

And 与

func (*Int) AndNot added in v0.3.4

func (slf *Int) AndNot(i *Int) *Int

AndNot 与非

func (*Int) Bit added in v0.3.4

func (slf *Int) Bit(i int) uint

Bit 二进制位

func (*Int) BitLen added in v0.3.4

func (slf *Int) BitLen() int

BitLen 二进制长度

func (*Int) Cmp

func (slf *Int) Cmp(i *Int) int

Cmp 比较,当 slf > i 时返回 1,当 slf < i 时返回 -1,当 slf == i 时返回 0

func (*Int) Copy

func (slf *Int) Copy() *Int

func (*Int) Div added in v0.3.4

func (slf *Int) Div(i *Int) *Int

func (*Int) DivInt added in v0.3.4

func (slf *Int) DivInt(i int) *Int

func (*Int) DivInt16 added in v0.3.4

func (slf *Int) DivInt16(i int16) *Int

func (*Int) DivInt32 added in v0.3.4

func (slf *Int) DivInt32(i int32) *Int

func (*Int) DivInt64 added in v0.3.4

func (slf *Int) DivInt64(i int64) *Int

func (*Int) DivInt8 added in v0.3.4

func (slf *Int) DivInt8(i int8) *Int

func (*Int) DivUint added in v0.3.4

func (slf *Int) DivUint(i uint) *Int

func (*Int) DivUint16 added in v0.3.4

func (slf *Int) DivUint16(i uint16) *Int

func (*Int) DivUint32 added in v0.3.4

func (slf *Int) DivUint32(i uint32) *Int

func (*Int) DivUint64 added in v0.3.4

func (slf *Int) DivUint64(i uint64) *Int

func (*Int) DivUint8 added in v0.3.4

func (slf *Int) DivUint8(i uint8) *Int

func (*Int) EqualTo

func (slf *Int) EqualTo(i *Int) bool

EqualTo 等于

func (*Int) GCD added in v0.3.4

func (slf *Int) GCD(i *Int) *Int

GCD 最大公约数

func (*Int) GreaterThan

func (slf *Int) GreaterThan(i *Int) bool

GreaterThan 大于

func (*Int) GreaterThanOrEqualTo

func (slf *Int) GreaterThanOrEqualTo(i *Int) bool

GreaterThanOrEqualTo 大于或等于

func (*Int) Int64

func (slf *Int) Int64() int64

func (*Int) IsEven added in v0.3.4

func (slf *Int) IsEven() bool

IsEven 是否为偶数

func (*Int) IsNegative added in v0.3.4

func (slf *Int) IsNegative() bool

IsNegative 是否为负数

func (*Int) IsOdd added in v0.3.4

func (slf *Int) IsOdd() bool

IsOdd 是否为奇数

func (*Int) IsPositive added in v0.3.4

func (slf *Int) IsPositive() bool

IsPositive 是否为正数

func (*Int) IsZero

func (slf *Int) IsZero() bool

func (*Int) LCM added in v0.3.4

func (slf *Int) LCM(i *Int) *Int

LCM 最小公倍数

func (*Int) LessThan

func (slf *Int) LessThan(i *Int) bool

LessThan 小于

func (*Int) LessThanOrEqualTo

func (slf *Int) LessThanOrEqualTo(i *Int) bool

LessThanOrEqualTo 小于或等于

func (*Int) Lsh added in v0.3.4

func (slf *Int) Lsh(i int) *Int

Lsh 左移

func (*Int) Mod added in v0.3.4

func (slf *Int) Mod(i *Int) *Int

func (*Int) ModInt added in v0.3.4

func (slf *Int) ModInt(i int) *Int

func (*Int) ModInt16 added in v0.3.4

func (slf *Int) ModInt16(i int16) *Int

func (*Int) ModInt32 added in v0.3.4

func (slf *Int) ModInt32(i int32) *Int

func (*Int) ModInt64 added in v0.3.4

func (slf *Int) ModInt64(i int64) *Int

func (*Int) ModInt8 added in v0.3.4

func (slf *Int) ModInt8(i int8) *Int

func (*Int) ModInverse added in v0.3.4

func (slf *Int) ModInverse(i *Int) *Int

ModInverse 模反元素

func (*Int) ModSqrt added in v0.3.4

func (slf *Int) ModSqrt(i *Int) *Int

ModSqrt 模平方根

func (*Int) ModUint added in v0.3.4

func (slf *Int) ModUint(i uint) *Int

func (*Int) ModUint16 added in v0.3.4

func (slf *Int) ModUint16(i uint16) *Int

func (*Int) ModUint32 added in v0.3.4

func (slf *Int) ModUint32(i uint32) *Int

func (*Int) ModUint64 added in v0.3.4

func (slf *Int) ModUint64(i uint64) *Int

func (*Int) ModUint8 added in v0.3.4

func (slf *Int) ModUint8(i uint8) *Int

func (*Int) Mul

func (slf *Int) Mul(i *Int) *Int

func (*Int) MulInt

func (slf *Int) MulInt(i int) *Int

func (*Int) MulInt16

func (slf *Int) MulInt16(i int16) *Int

func (*Int) MulInt32

func (slf *Int) MulInt32(i int32) *Int

func (*Int) MulInt64

func (slf *Int) MulInt64(i int64) *Int

func (*Int) MulInt8

func (slf *Int) MulInt8(i int8) *Int

func (*Int) MulUint

func (slf *Int) MulUint(i uint) *Int

func (*Int) MulUint16

func (slf *Int) MulUint16(i uint16) *Int

func (*Int) MulUint32

func (slf *Int) MulUint32(i uint32) *Int

func (*Int) MulUint64

func (slf *Int) MulUint64(i uint64) *Int

func (*Int) MulUint8

func (slf *Int) MulUint8(i uint8) *Int

func (*Int) Neg added in v0.3.4

func (slf *Int) Neg() *Int

Neg 返回数字的相反数

func (*Int) Not added in v0.3.4

func (slf *Int) Not() *Int

Not 非

func (*Int) Or added in v0.3.4

func (slf *Int) Or(i *Int) *Int

Or 或

func (*Int) Pow added in v0.3.4

func (slf *Int) Pow(i *Int) *Int

func (*Int) PowInt added in v0.3.4

func (slf *Int) PowInt(i int) *Int

func (*Int) PowInt16 added in v0.3.4

func (slf *Int) PowInt16(i int16) *Int

func (*Int) PowInt32 added in v0.3.4

func (slf *Int) PowInt32(i int32) *Int

func (*Int) PowInt64 added in v0.3.4

func (slf *Int) PowInt64(i int64) *Int

func (*Int) PowInt8 added in v0.3.4

func (slf *Int) PowInt8(i int8) *Int

func (*Int) PowUint added in v0.3.4

func (slf *Int) PowUint(i uint) *Int

func (*Int) PowUint16 added in v0.3.4

func (slf *Int) PowUint16(i uint16) *Int

func (*Int) PowUint32 added in v0.3.4

func (slf *Int) PowUint32(i uint32) *Int

func (*Int) PowUint64 added in v0.3.4

func (slf *Int) PowUint64(i uint64) *Int

func (*Int) PowUint8 added in v0.3.4

func (slf *Int) PowUint8(i uint8) *Int

func (*Int) ProportionalCalc added in v0.3.4

func (slf *Int) ProportionalCalc(proportional *Int, formula func(v *Int) *Int) *Int

ProportionalCalc 比例计算,该函数会再 formula 返回值的基础上除以 proportional

  • formula 为计算公式,该公式的参数为调用该函数的 Int 的拷贝

func (*Int) Rsh added in v0.3.4

func (slf *Int) Rsh(i int) *Int

Rsh 右移

func (*Int) Set

func (slf *Int) Set(i *Int) *Int

func (*Int) SetBit added in v0.3.4

func (slf *Int) SetBit(i int, v uint) *Int

SetBit 设置二进制位

func (*Int) SetInt

func (slf *Int) SetInt(i int) *Int

func (*Int) SetInt16

func (slf *Int) SetInt16(i int16) *Int

func (*Int) SetInt32

func (slf *Int) SetInt32(i int32) *Int

func (*Int) SetInt64

func (slf *Int) SetInt64(i int64) *Int

func (*Int) SetInt8

func (slf *Int) SetInt8(i int8) *Int

func (*Int) SetUint

func (slf *Int) SetUint(i uint) *Int

func (*Int) SetUint16

func (slf *Int) SetUint16(i uint16) *Int

func (*Int) SetUint32

func (slf *Int) SetUint32(i uint32) *Int

func (*Int) SetUint64

func (slf *Int) SetUint64(i uint64) *Int

func (*Int) SetUint8

func (slf *Int) SetUint8(i uint8) *Int

func (*Int) Sign added in v0.3.4

func (slf *Int) Sign() int

Sign 返回数字的符号

  • 1:正数
  • 0:零
  • -1:负数

func (*Int) Sqrt added in v0.3.4

func (slf *Int) Sqrt() *Int

Sqrt 平方根

func (*Int) String

func (slf *Int) String() string

func (*Int) Sub

func (slf *Int) Sub(i *Int) *Int

func (*Int) SubInt

func (slf *Int) SubInt(i int) *Int

func (*Int) SubInt16

func (slf *Int) SubInt16(i int16) *Int

func (*Int) SubInt32

func (slf *Int) SubInt32(i int32) *Int

func (*Int) SubInt64

func (slf *Int) SubInt64(i int64) *Int

func (*Int) SubInt8

func (slf *Int) SubInt8(i int8) *Int

func (*Int) SubUint

func (slf *Int) SubUint(i uint) *Int

func (*Int) SubUint16

func (slf *Int) SubUint16(i uint16) *Int

func (*Int) SubUint32

func (slf *Int) SubUint32(i uint32) *Int

func (*Int) SubUint64

func (slf *Int) SubUint64(i uint64) *Int

func (*Int) SubUint8

func (slf *Int) SubUint8(i uint8) *Int

func (*Int) ToBigint

func (slf *Int) ToBigint() *big.Int

func (*Int) Xor added in v0.3.4

func (slf *Int) Xor(i *Int) *Int

Xor 异或

Jump to

Keyboard shortcuts

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