Documentation
¶
Overview ¶
Package cardinal provides representations for cardinal numbers (cardinalities) used to express the size of algebraic structures such as groups, rings, and fields.
See README.md for details.
Index ¶
- type Cardinal
- type Known
- func (k Known) Add(other Cardinal) Cardinal
- func (k Known) Big() *big.Int
- func (k Known) BitLen() int
- func (k Known) Bytes() []byte
- func (k Known) BytesBE() []byte
- func (k Known) Clone() Cardinal
- func (k Known) Equal(other Cardinal) bool
- func (k Known) HashCode() base.HashCode
- func (Known) IsFinite() bool
- func (k Known) IsLessThanOrEqual(other Cardinal) bool
- func (k Known) IsProbablyPrime() bool
- func (Known) IsUnknown() bool
- func (k Known) IsZero() bool
- func (k Known) Mul(other Cardinal) Cardinal
- func (k Known) Nat() *numct.Nat
- func (k Known) String() string
- func (k Known) Sub(other Cardinal) Cardinal
- func (k Known) Uint64() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cardinal ¶
Cardinal is an alias for algebra/crtp.Cardinal, which is the interfaces satisfying different types of cardinals.
func NewFromBig ¶
NewFromBig creates a new Cardinal from a big.Int value.
func NewFromNumeric ¶
NewFromNumeric creates a new Cardinal from a Numeric value.
type Known ¶
type Known []byte
Known represents a cardinal number with a known value.
func (Known) IsFinite ¶
IsFinite checks if the known cardinal is finite, which is always true for Known.
func (Known) IsLessThanOrEqual ¶
IsLessThanOrEqual checks if the known cardinal is less than or equal to another cardinal.
func (Known) IsProbablyPrime ¶
IsProbablyPrime checks if the known cardinal is probably prime.
func (Known) IsUnknown ¶
IsUnknown checks if the known cardinal is unknown, which is always false for Known.